Replikwando Error Logging
Contained within this page are the inner workings of Replikwando's logging system as of version 1.7.0.
Log Levels
This setting determines what severity of issue is logged. Each level includes all the ones of higher priority as well.
Values
This value can be set in replication.ini, logging::loglevel.
Only one value is accepted, in the form of:
- loglevel=<log_level_value>
Acceptable values are (in order of criticality):
- CRITICAL
- ERROR
- WARNING
- GENERAL
- NOTIFY
- DEBUG
Critical
Notifies the user that there are issues that require immediate attention (whether by user or programmer), and that Replikwando cannot function normally until they are corrected.
Examples:
- Basic configuration is not set
- Could not connect to local or remote database on startup
- Binary logging is not enabled
- Could not create or open sqlite file
- Processing threads have died unexpectedly (programmer must correct)
- CRT or other generic unhandled error or exception (programmer must handle)
Error
Notifies the user that issues are coming up that are stopping Replikwando from functioning correctly.
Examples:
- Loss of local or remote connection
- Inability to trigger a heartbeat
Warning
Notifies the user that some issues are coming up, but Replikwando is capable of getting along without intervention.
Examples:
- Any query that errors out for known reasons like DUPLICATE KEY or ALREADY_EXISTS
General
Details important state changes (like repushing) and other things that are nice to know, but won't require action by the users.
Examples:
- Repush started
- Repush finished
Notify
Details general state changes and higher-level debugging information.
Examples:
- Heartbeat message received
- Discarded known duplicate query (ROLLBACK; ROLLBACK;)
- Function creation without determinism set
- Short-form queries being added to sqlite file
Debug
Contains tons of otherwise-useless output; queries being written out and such.
Not good for general use.
Examples:
- First 2KB of each query being sent to remote server.
Log Types
This setting determines what sources of message are considered for logging. It is completely agnostic of severity.
Values
This value can be set in replication.ini, logging::log_types.
Multiple values may be specified on this line, in the form of
- log_types=<log_type_value>[ log_type_value...]
Acceptable values are:
- GENERAL
- STARTUP
- SHUTDOWN
- PERFORMANCE
- THREAD_MAIN
- THREAD_READ
- THREAD_PARSE
- THREAD_STORE
- THREAD_SEND
- THREAD_HEARTBEAT
- EXTRA_DATA_SQLITE_CHANGE
- TEST_SUITE
General
Catch-all category for anything that comes from non-specific locations. It should probably always be enabled.
Startup
Issues that occur while Replikwando is starting up and putting itself into a normal running state.
Shutdown
Issues that occur while Replikwando is closing down and cleaning up values.
Performance
Logged values related to performance, such as query lengths and queue sizes.
Thread_Main
Issues that occur in the main thread of Replikwando. The main thread doesn't do much, and most if not all values that go here would be better handled under General instead.
Thread_Read
Issues that occur during reading values from the local database.
Thread_Parse
Issues that occur during the parsing of unparsed queries. Involves tokenization and introspection of MySQL queries.
Thread_Store
Issues that occur during saving parsed queries to the SQLite database file.
Thread_Send
Issues that occur during sending values to any number of remote databases.
Thread_Heartbeat
Issues that occur during the triggering of heartbeats, or the reading and writing of Replikwando Messages.
Extra_data_SQLite_Change
Notifications for SQLite values being manipulated. Performance logging.
Test_Suite
Eventually will be used for parse-friendly output to enable testing. I hope.
Log Format
Currently, the log format is hard-coded to be:
- Locale_String_Date_Time [Log_Level : Log_Type] - Full_Message
Please note that Full_message may have any variety of formatting, including tabbing, unescaped raw ascii values, and line returns.
Known Errors
Please review this wiki page.