info.jitcom:logging

Logging related framework


License
MIT

Documentation

Logging

All in one logging Package used for most of our projects.

The most important features are:

  • logging exceptions with full stacktraces
  • Uncaught exception logging (any exception that dont get caught in a try catch)
  • Automatic deletion of old logs
  • Thread safe logging

Getting Started

You can get the artifact from:

<groupId>info.jitcom</groupId>
<artifactId>logging</artifactId>
<version>1.1</version>

Initializing

Provide a path to a folder where the logs should be written to:

Logger.initialize("path/to/log/folder");

Logger.add_log("Hello, World");

Log file name

{Log_level};{Station_name}@{User_name}-{Process_ID}-{Week_of_year}_{Init_class_name}.log

Logging exceptions

try {
    ...
} catch (Exception e) {
    Logger.add_log(e);
}

Changing Log Level

Exceptions are default logged into either Log_level.Error or Log_level.Uncaught. You can change that to whatever you want like so:

try {
    ...
} catch (Exception e) {
    Logger.add_log(e, Log_level.Trace);
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details