Logging API
This section includes the logging description in the framework.
Always consider adding logging to classes that could require debugging or monitoring. |
Basic Usage
You can create/get an instance of JKLogger
by using the following code segment:
JKLogger logger=JKLoggerFactory.getLogger(getClass());
Such as:
public class YourClass{
JKLogger logger=JKLoggerFactory.getLogger(getClass());
...
public void method(String param1){
logger.info("method1() with param {}",param1);
....
...
logger.info("\method1()");
}
Note that the "{}" braces are used as placeholders for variables, and they are served by order.
Logging Config File
The current implementation is based on LogBack API, so we provide a default logging configuration as available out of the box in the framework.
For having a custom logging configuration, create src/main/resources/logback.xml
file which shall contain
your custom configurations. Check LogBack Config for more
information.
For unit testing, the logback file name should be named |