...
Panel |
---|
|
Logger writes information in log file.
What does this section cover? |
Define a logger
A logger is defined in the following path: project_name/src/main/resources/metadata/logbackloggers.xml:
-loggername and logbackappenderfilename must be unique
-logbackclassname must be defined only once
Code Block |
---|
title | Define logger |
---|
collapse | true |
---|
|
<logbackconfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/applications.xsd">
<logbackloggers>
<logbacklogger>
<loggername>kounta</loggername>
<logbackappenderfilename>kounta</logbackappenderfilename>
<logbackclasses>
<logbackclass>
<logbackclassname>com.crm.kounta.webapi.KOUNTAUtilBean</logbackclassname>
</logbackclass>
</logbackclasses>
</logbacklogger>
</logbackloggers>
</logbackconfig>
|
Update pom.xml
Code Block |
---|
title | Update pom.xml |
---|
collapse | true |
---|
|
....
<dependencies>
....
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
|
Disable standalone configuration:
Add the following in standalone.xml under wildfly\standalone\configuration :
Code Block |
---|
title | Disable standalone configuration |
---|
collapse | true |
---|
|
<subsystem xmlns="urn:jboss:domain:logging:3.0">
<add-logging-api-dependencies value="false"/>
<use-deployment-logging-config value="false"/>
.......
</subsystem> |
...
Invoke the logger object
If the file extends CRMBase:
...