-
Type: Task
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: QualifiedToSchedule
-
Component/s: Distribution / Installers
Add to the platform the basic configuration needed for JSON logging through log4j2:
Add the following jars
jackson-annotations-2.8.0
jackson-core-2.8.7.jar
jackson-databind-2.8.7.jar
Add the following RollingFile section in log4j2.xml:
<RollingFile name="JSON-FILE" fileName="${sys:nuxeo.log.dir}/server-json.log" append="true" filePattern="${sys:nuxeo.log.dir}/server-json-%d{yyyy-MM-dd}.log"> <JSONLayout compact="true" eventEol="true"/> <PatternLayout pattern="%highlight{%d %p [%c] - <%m>}%n"/> <Policies> <OnStartupTriggeringPolicy /> <SizeBasedTriggeringPolicy size="10 MB"/> <TimeBasedTriggeringPolicy /> </Policies> <DefaultRolloverStrategy max="5" compressionLevel="9"> <Delete basePath="${sys:nuxeo.log.dir}" maxDepth="2"> <IfFileName glob="*/*.log.gz" /> <IfLastModified age="7d" /> </Delete> </DefaultRolloverStrategy> </RollingFile>
To activate it in production, we would also add the following section in log4j2.xml:
<Root level="warn"> <AppenderRef ref="CONSOLE" /> <AppenderRef ref="FILE" /> <AppenderRef ref="JSON-FILE" /> </Root>
- depends on
-
NXP-23863 Switch logger backend to Log4j 2
- Resolved