Menu

About Logging and Logging Levels

TheLiv

Logging in aws-s3-version-mgmt

Logging was introduced with version 1.0.1 and it is done via SLF4J -- so you can plug in any adapter for SLF4J you want. As of version 1.0.1, the utility comes prepackaged with SLF4J-Simple which dumps out log info to console output.

This page on the tool website gives more information on how to use/configure logging in this application.

We are still looking at making this mechanism configurable from command line via arguments to the utility rather than via swapping in and out jars and config files.

Logging Levels

When writing code for aws-s3-version-mgmt please use mostly DEBUG and TRACE for providing debug information. Typically these are filtered out by default configuration so we don't "bombard" the user with lots of unwanted debug information!

WARN and ERROR are shown so use those to signal a serious problem with the program execution -- use WARN for recoverable problems and ERROR to signal serious exceptions/errors.

Regarding TRACE vs DEBUG, here's a few pointers:

  • All utility classes (classes which only offer static methods) should log using TRACE level. This means everything under com.liviutudor.aws.versionmgmt.util should only use TRACE. This is because typically these methods are called from other objects, and are "utilities" rather than part of the execution of the program.

  • Since all BasicVersionPredicate classes are really utilities (they get called/used inside a PredicateS3Filter) they should log everything using TRACE too. This means that everything under com.liviutudor.aws.versionmgmt.filter.predicate should log only using TRACE.


Related

Wiki: Home