diff --git a/examples/propertyConf/.gitignore b/examples/propertyConf/.gitignore new file mode 100644 index 0000000..5acf573 --- /dev/null +++ b/examples/propertyConf/.gitignore @@ -0,0 +1,5 @@ +target/ +.settings/ +.project +.classpath +.factorypath \ No newline at end of file diff --git a/examples/propertyConf/pom.xml b/examples/propertyConf/pom.xml new file mode 100644 index 0000000..56a8d4b --- /dev/null +++ b/examples/propertyConf/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + com.github.dubasdey + log4j2-jsonevent-layout-example-property-conf + 0.0.1 + log4j2-jsonevent-layout + Log4j2 JSON Event layout properties config example + https://github.com/dubasdey/log4j2-jsonevent-layout + + + + GNU LGPL v3 + https://www.gnu.org/licenses/lgpl-3.0.en.html + repo + + + + + https://github.com/dubasdey/log4j2-jsonevent-layout + scm:git:git://github.com/dubasdey/log4j2-jsonevent-layout.git + scm:git:git@github.com:dubasdey/log4j2-jsonevent-layout.git + + + + 8 + 8 + UTF-8 + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + erodriguez + Eduardo Rodríguez + eduardo@rodriguezcarro.es + + + + + + + org.apache.logging.log4j + log4j-core + 2.17.1 + + + + com.github.dubasdey + log4j2-jsonevent-layout + 0.0.7 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + utf-8 + 1.8 + 1.8 + + + + + diff --git a/examples/propertyConf/src/main/java/org/erc/log4j2/layout/examples/basic/Main.java b/examples/propertyConf/src/main/java/org/erc/log4j2/layout/examples/basic/Main.java new file mode 100644 index 0000000..156ef19 --- /dev/null +++ b/examples/propertyConf/src/main/java/org/erc/log4j2/layout/examples/basic/Main.java @@ -0,0 +1,14 @@ +package org.erc.log4j2.layout.examples.basic; + + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Main { + + private static final Logger logger = LogManager.getLogger(Main.class); + + public static void main(String[] args){ + logger.info("Debug line"); + } +} diff --git a/examples/propertyConf/src/main/resources/log4j2.properties b/examples/propertyConf/src/main/resources/log4j2.properties new file mode 100644 index 0000000..92a6aa1 --- /dev/null +++ b/examples/propertyConf/src/main/resources/log4j2.properties @@ -0,0 +1,12 @@ +rootLogger.level = DEBUG +rootLogger.appenderRef.console.ref = STDOUT + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.target=SYSTEM_OUT +appender.console.layout.type = JSONLog4j2Layout +appender.console.layout.singleLine = true +appender.console.layout.locationInfo = true +appender.console.layout.xxx.type = UserField +appender.console.layout.xxx.key = jobId +appender.console.layout.xxx.value = 111 \ No newline at end of file