Skip to content
Andres Gomez Casanova edited this page Jun 3, 2022 · 5 revisions

These are the possible error codes raised by log4db2

Errors while using the utility

The following errors appear when calling the utility.

Conventions

ERROR CODE

Descriptive message

  • Error description.
    • User response.

LEVELS table

LG0L1

LEVEL_ID should be equal to or greater than zero.

  • When inserting into the LEVELS table, any LEVEL_ID provided should be greater or equal to zero.
    • Reissue the insert statement with a LEVEL_ID greater than zero.

LG0L2

LEVEL_ID should be consecutive to the previous maximal value.

  • When inserting into the LEVELS table, it is not possible to have gaps in the LEVEL_ID values.
    • Check the current maximal value in the LEVELS table, and try a LEVEL_ID with a value of MAX + 1.

LG0L3

It is not possible to change the LEVEL_ID.

  • Once a LEVEL_ID has been inserted in a LEVELS row, it cannot be modified. There could be references to this value in other tables (for example LOGS) without enforcing the referential integrity. If this value is modified, it will appear incoherent. At the same time, it is not possible to assign a new value without creating gaps in the table.
    • Delete values and re-insert, them to adapt the structure to your requirements.

LG0L4

Trying to delete the minimal value.

  • The operation is trying to delete the minimal value which is 0, and this is not allowed because there must be at least a defined level in the LEVELS table.
    • Delete other values, but not the minimal one.

LG0L5

The only possible LEVEL_ID to delete is the maximal value.

  • The issued statement is trying to delete a LEVEL_ID different from the maximal in the LEVELS table. It is prohibited because this will create gaps in the list of LEVELS.
    • You must delete levels by deleting the maximal LEVEL_ID value.

LG0L6

The given logger name has not been found.

  • When trying to register or update a level logger with the LOGADMIN.REGISTER_LOGGER procedure, the given level name is not valid.
    • Check the level enterer. The name should match a level from the LEVELS table. By default they are in lower case: off, fatal, error, warn, info, debug.

CONF_LOGGERS table

LG0C1

The only logger without a parent is ROOT.

  • All loggers should have a parent. The only one that does not have ascendancy is ROOT.
    • Assign a parent to the provided logger. Probably, its parent will be ROOT (0).

LG0C2

It is not possible to update any value in this table (only LEVEL_ID is possible).

  • Once a logger has been created, most of its properties cannot be changed. The LOGGER_ID helps to uniquely identify it. NAME is a unique value in the hierarchy. PARENT_ID indicates its ancestry.
    • Do not try to modify the values of a logger. If a logger was misdefined, create a new one (new LOGGER_ID, correct NAME, probably same PARENT_ID).

LG0C3

There could be only one ROOT logger

  • Trying to insert a second ROOT logger with values (ID = 0, PARENT = NULL), however, it already exists in the table.
    • This operation is not permitted, insert other levels different from ROOT.

CONF_LOGGERS_EFFECTIVE table

LGxE1 (LGAE1, LGBE1)

The only logger without a parent is ROOT.

  • All loggers should have a parent. The only one that does not have ascendancy is ROOT. Remember that this table is managed by the utility, this means that the users do not have to modify it directly.
    • Assign a parent to the provided logger. Probably, its parent will be ROOT (0).

LG0E2

It is not possible to update any value in this table (only LEVEL_ID is possible).

  • Once a logger has been created, most of its properties cannot be changed. The LOGGER_ID helps to uniquely identify it. NAME is a unique value in the hierarchy. PARENT_ID indicates its ancestry. Remember that this table is managed by the utility, this means that the users do not have to modify it directly.
    • Do not try to modify the values of a logger. If a logger was misdefined, create a new one (new LOGGER_ID, correct NAME, probably same PARENT_ID).

LG0E3 (LGAE3, LGBE3)

It is not possible to update the LEVEL_ID manually.

  • The LEVEL_ID is updated when the associated configuration in the CONF_LOGGERS table is modified. However, this value cannot be modified manually, and it should match the established value in the configuration table.
    • Update the LEVEL_ID to the same level defined in the CONF_LOGGERS table.

LG0E4

ROOT logger cannot be deleted.

  • There should always exist the ROOT logger in the CONF_LOGGERS_EFFECTIVE table. It cannot be deleted, because this is the origin of the ancestry for any level.
    • If you are deleting in bulk (DELETE FROM CONF_LOGGERS_EFEFCTIVE) put a condition to not delete the ROOT logger.

LG0E5

Inserting a duplicate logger.

  • It already exists a logger with the same name in the same position of the hierarchy (same PARENT_ID).
    • Use the existing LOGGER_ID or change the name for the logger in the same level of the hierarchy. You can also change the PARENT_ID, but that changes the logger in the hierarchy with another ascendancy/descendancy.

CONF_APPENDERS table

LG0A1

APPENDER_ID for appenders should be greater or equal to zero.

  • Any APPENDER_ID should be greater or equal to zero, and the statement is issuing a negative value.
    • Reissue the statement with a positive or zero value.

GET_DEFINED_PARENT_LOGGER function

LG0F1

Invalid parameter.

  • The provided value to call the function is not a valid value. It is probably a null value or a negative one.
    • Reissue the command calling the function with a positive or zero value.

FUNCTIONS

LG001

  • The call has arrived at the limit in cascade call and the log could not be written correctly. It was written as ROOT logger and an error was returned to the caller application. This message wraps the SQL Code SQL0724, SQLState 54038.
    • Control this error in the application.

In order to continue the execution:

DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001' DO_SOMETHING;

LG002

Invalid configuration state

  • The loggers' cache is trying to be activated or deactivated, but the configuration is the opposite of the requested function. This behavior should never be an issue for the user because the procedures used (ACTIVATE_CACHE and DEACTIVATE_CACHE) are called by triggers.
    • Reissue the command with the appropriated function according to the configuration.

For example:

  • ACTIVATE_CACHE -> internalCache = true
  • DEACTIVATE_CACHE -> internalCache = false

##Messages in the LOGS table##

Some error conditions are reported in the LOGS table. They describe the internal behavior of the utility.

  • A manual CONF_LOGGERS_EFFECTIVE update should be realized.
    • The defaultRootLevelId configuration value has been changed. ROOT logger and eventually other loggers do not have a defined level, and they have to be changed with the new configuration value. This cannot be automatically done (there is a trigger issue), and the user needs to update the ROOT logger in order to update these values.
UPDATE LOGDATA.CONF_LOGGERS
  SET LEVEL_ID = 0
  WHERE LOGGER_ID = 0;