Settings for Custom Logging in Tigase
Prev | Chapter 7. Configuration | Next

## Settings for Custom Logging in Tigase

Logging can be an important tool to monitor your server’s health and performance. Logging may be controlled and customized on a per-component basis.

A `logging` bean has been implemented to allow more fine configuration of each component.

    logging () {
        rootLevel = CONFIG
        'packet-debug-full' = true
        loggers = {
            'tigase.server' = {
                level = ALL
            }
            'tigase.conf' = {
                level = FINEST
            }
        }
        handlers = {
            ' java.util.logging.FileHandler' = {
                level = ALL
                append = true
                count = 5
                formatter = 'tigase.util.LogFormatter'
                limit = 10000000
                pattern = 'logs/tigase.log'
            }
            'java.util.logging.ConsoleHandler' = {
                level = WARNING
                formatter = 'tigase.util.LogFormatter'
            }
        }
    }

You only need to specify the settings you wish to customize, otherwise they will be left as default.

- `packet-debug-full` - controls whether log entries should be obfuscated (all CData of all elements will be replaced by `CData size: <length in bytes of the replaced string>`) or not; default: `false`.
- `rootLevel` - Defines the root level of logging for all components not otherwise defined. Default is CONFIG
- `loggers` - Defines the level of logging for packages running in tigase server. This is similar to the --debug setting, however you must use `tigase.{package}` format. Default is NONE.

- `handlers` - Defines the level of logging for File output and Console output.

  1. `FileHandler` - is the file output for log files, with the following options:

     1. `level` - specifies the level of logs to be written, default is ALL.
     2. `append` - whether to append to the log or replace it during restart. Default is true.
     3. `count` - number of individual log files to keep at set limit. Default is 5. (default settings will continue appending logs until 5 files at 10MB are reached, then the oldest file will be overwritten.)
     4. `formatter` - specifies the package to format logging output. Default is tigase.util.LogFormatter.
     5. `limit` - Byte limit for each log file. Default is 10000000 or 10MB.
     6. `pattern` - Directory and filename of the log file with respect to the Tigase installation directory. Default is logs/tigase.log.

  2. `ConsoleHandler` - Determines the formatting for Tigase output to console.

     1. `level` - specifies the level of logs to be written, default is WARNING.
     2. `formatter` - specifies the package to format logging output. Default is tigase.util.LogFormatter.

Prev | Up | Next
Virtual Hosts in Tigase Server | Home | Tigase Advanced Options