-
Notifications
You must be signed in to change notification settings - Fork 2
Logging
Please note that Log4j 2 functions are included through the Spring Boot Starter for Log4j 2, spring-boot-starter-log4j2. This project will continue using that version until we need to update either Log4j 2 or Spring Boot.
The Apache Log4j 2 2.11.2 library is used for logging. This version was published February 2019, and is available in the Maven Central Repository in log4j-core 2.11.2 and log4j-api 2.11.2. The base library is available at the Apache Log4j 2 archives
In the NIST-CTS-Agents repository, the configuration file is in /dev/src/main/resources/log4j2.xml.
Logs are stored on your local system in the dev/logs folder. Ledgers are stored on your local system in the dev/ledger folder. Ledgers (see the project README) contain committed transactions, and may be used to build an actor's position.
Log4j 2 supports conventional and standard logging levels as well as custom levels. The standard levels are, from most specific to least specific (and lowest IntLevel to highest) is:
- OFF (most specific, no logging)
- FATAL (most specific, little data)
- ERROR
- WARN
- INFO
- DEBUG
- TRACE (least specific, a lot of data)
- ALL (least specific, all data)
More information on the logging levels is available from the Apache Log4j 2 documentation.
The next section describes the project setup for logging, and indicates where that setup is expressed so you can change if necessary.
There are two types of rolling logs, one is for normal logging and the other is for ledgers. All logs described here are tab-separated text to simplify analysis with Excel and other spreadsheets (rather than for best human readability).
All of the logs from org.theenergymashuplab go in the logs folder dev/logs of your local system and print on the console.
The levels set are TRACE (used rarely) and INFO; see the source code and dev/src/main/resources/log4j2.xml. The level that is output can be changed in log4j2.xml.
Logs created by org.theenergymashuplab.cts.controller.payloads.EiCreateTransactionType are set to level INFO and will go to the ledger folder.
The trace level to be logged can be changed in log4j2.xml in resources. A typical project setup for debugging would use levels such as DEBUG, TRACE, or possibly ALL. Here is the XML tag with the default logging level (set in this example to "all"):
<Root level="all">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingLog" />
</Root>
For a project packaged as an executable JAR (Java Archive) file, command line options with the -D flag can set the default logging level. See the documentation for details. This project as of this writing creates a deployable war (Web Archive) file, not a jar.
All the logs generated by hibernate (for MySQL interactions) will be printed on console and go to the application general log.
Code Documentation
- Actor Pseudocode - LMA, LMM, TEUA
- RESTful Controller Payloads
- Position Manager
- Logging
- Time in CTS
- UML and Java Classes
- Simple Binary Encoding (SBE)
- SBE Quick Guide
- Auction Market
Building and Running the Project
- Setup Run and Drive - with YouTube videos
- Dependencies and Prerequisites
- Set Up MySQL
- Parity Terminal Client
- Project Build Steps
- In Case of Difficulty
Docker
- Docker Background
- Docker Setup Requirements
- Docker Setup Part 1
- Docker Setup Part 2
- Running EML-CTS as a Single Executable JAR
- Docker Quick Guide
General Tech Guides
Spring 2024 Updates