Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
visionx:use_log4j [2025/06/23 09:59]
admin created
visionx:use_log4j [2025/06/23 13:31] (current)
admin
Line 3: Line 3:
  
 This is a very technical article and it's only relevant for developers or experienced users. Usually the integrated log mechanism is good enough, but from a developer point of view it might be helpful to use a different log mechanism. This is a very technical article and it's only relevant for developers or experienced users. Usually the integrated log mechanism is good enough, but from a developer point of view it might be helpful to use a different log mechanism.
 +
 +Every application will be created with a **loggerfactory.properties** in the **test** directory. If you keep the file in the test directory, your application won't use customized logging after installation/​deployment. If you want to use customized logging for the installed/​deployed application,​ just move the file to the **src.server** folder. To configure log4j, simply remove the **#** from the first line. It will look like
 +
 +<​code>​
 +default.class=com.sibvisions.util.log.log4j.Log4jLoggerFactory
 +</​code>​
 +afterwards.
 +
 +Also create a [[jvx:​common:​util:​log4j|log4j.properties]] or [[jvx:​common:​util:​log4j|log4j2.xml]] in the **src.server** folder.
 +
 +This was the configuration part, now you need the log4j libraries. Please download:
 +
 +  * [[https://​repo1.maven.org/​maven2/​org/​apache/​logging/​log4j/​log4j-1.2-api/​2.25.0/​log4j-1.2-api-2.25.0.jar|log4j api bridge (2.25.0)]]
 +  * [[https://​repo1.maven.org/​maven2/​org/​apache/​logging/​log4j/​log4j-api/​2.25.0/​log4j-api-2.25.0.jar|log4j 2 api (2.25.0)]]
 +  * [[https://​repo1.maven.org/​maven2/​org/​apache/​logging/​log4j/​log4j-core/​2.25.0/​log4j-core-2.25.0.jar|log4j 2 core 2.25.0)]]
 +
 +and put all into the **libs/​server** directory. ​
 +
 +If you run your application in Eclipse or any other IDE, be sure to add all 3 libraries to your build path (classpath) and also as Deployment Assemlbies.
  
  
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information