Skip to content

Logger to Chat Message

Innocent Bystander edited this page Aug 13, 2015 · 1 revision

The bot is able to redirect messages from the python logging facilities into any conversation. This is a feature intended for both developers and bot administrators - modern plugins tend to favor using the python logger for reporting programmatic and administrative events.

Commands

Registered in system plugin: commands.loggertochat

/bot logconfig <plugin/module> <log level>

  • Monitors the log for events that arise from the specified <plugin/module>, and send a chat message when the event matches or exceeds the <log level>
    • A list of plugin/module names is available via /bot plugininfo - <plugin/module> must be the plugins full path e.g. plugins.restrictedadd, plugins.default, etc
    • <log level> should be the numerical value or label name based on the python logging levels
      • It is best to set this at 30/WARNING - as most administrative events of interest tend to be emitted at this level - it can be set higher or lower depending on the verbosity of the plugin
      • Unless you are a developer, the DEBUG or INFO log level is probably too verbose to be useful
      • Setting <log level> to 0 will disable monitoring for the <plugin/module>
  • Log messages will be redirected into any conversation that is tagged receive-logs
  • To list all logging settings, you can issue the command: /bot config get logging (requires Default Commands plugin)

/bot lograise <log level name>

  • This is a test command that will "emit" a log message at the specified <log level name> (based on python logging levels from the commands.loggertochat system module

Plugin Limitations

Some plugins may not necessarily emit the proper log levels for administrative monitoring. If you encounter a plugin that you feel has insufficient logging, please use the Issue Tracker to report it so that action can be taken in a future upgrade.

# ## ###

Clone this wiki locally