Websydian v6.1 online documentationOnline documentation - Websydian v6.1

LogType Entity

The LogType entity specifies the different types of Log messages that can be generated by the application.  Each Log record generated by the application must belong to a specific Log Type.

The LogType entity pattern inherits from the EditDetail entity in FOUNDATION which itself inherits from the DataAccess pattern in the STORAGE library.

Working with Different Log Types

A small number of Log Types have been pre-defined in the Audit module.  These cover the basic logging and the various System Errors that can occur in a Websydian application.  The pre-defined Log Types are generated automatically by the InitializeLogTypes function which creates a Log Type record for each model value belonging to the LogTypeID field.

New Log Types can be specified by the developer and hence used in the action diagram code.  Declaring a new Log Type is done by adding a new value to the local implementation of the LogTypeID field.  A literal value must be declared for the field and the narrative specification of the new value must associate to the LogTypeKind field (Information, Application error, System error).  When specified in the model, the new Log Types can be created in the database by running the InitializeLogTypes service function.

Usually, the same Log Type will only be used once in the action diagram code.  This is the case for the pre-defined Log Types.

LogType Fields

The LogType entity has the following fields:

LogTypeKind Specifies the three different kinds of log types:

Information: for non-error messages.  Information Messages can be used for logging all kinds of relevant business information while the application is running.  A few Information Messages logging the basic event handling have been pre-defined in the Audit module.

Application error: for logging errors specific to the application, e.g. "Credit max exceeded".  No Application Errors have been pre-defined in the Audit module.

System error: for errors related to mistakes made during development and set-up, e.g. "Unable to call Event Handler".  A number of System Errors have been pre-defined in the Audit module.

LogTypeID The Log Type identification specifies the type of Audit message.  A number of values have been pre-defined for the field corresponding to various Information Messages and System Errors.

When implementing the Audit module, the LogTypeID field must be replaced by a local model field, so that new Log Type values can be added.

When adding a new value for the Log Type field, a literal value above 1000 must be specified.  The first 1000 numbers are reserved for Websydian use.  In addition, the narrative specification of the new value must associate to the literal value of the correct LogTypeKind field value.

LogTypeDescription This field will be loaded with the unscoped name of the corresponding Log Type field value during initialization.
LogTypeEnabled Flag field that determines whether the Log Type will be logged or not.  If switched off, no logging of the specified type will occur.

The value of the field is set by the administrator of the web application.

By default, the flag is switched on, enabling logging of the Log Type.