Skip to content

Commit 4f96442

Browse files
authored
OpenTelemetry Initial Support (#626)
* Log4J maven version refactoring. Bump version * Add log4j json pattern layout support * Fix build error * Fix build * Keep using current log4j version in order not to break fullgx comparison * Add OpenTelemetry API * Bump Log4J version * Restore logj2 1.2 API
1 parent b8ada6a commit 4f96442

File tree

4 files changed

+59
-24
lines changed

4 files changed

+59
-24
lines changed

gxawsserverless/src/test/java/log4j2.xml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Configuration status="warn">
33
<Properties>
4-
<Property name="logPath">logs</Property>
4+
<Property name="logBaseDir">${main:0:-.}${sys:file.separator}logs${sys:file.separator}</Property>
5+
6+
<Property name="logFile">${logBaseDir}client.log</Property>
57
</Properties>
8+
69
<Appenders>
7-
<Console name="GeneXusDefaultLogger" target="SYSTEM_OUT">
8-
<PatternLayout pattern="%p\t%d{ISO8601}\t%r\t%c\t[%t]\t%m%n"/>
10+
<RollingFile name="RollingFile" fileName="${logFile}" filePattern="${logBaseDir}old${sys:file.separator}app-%d{yyyy-MM-dd-HH}-%i.log.gz">
11+
<PatternLayout pattern="%d{ISO8601} [%t] %-5p %c - %m%n"/>
12+
13+
<Policies>
14+
<TimeBasedTriggeringPolicy />
15+
<SizeBasedTriggeringPolicy size="10 MB"/>
16+
</Policies>
17+
</RollingFile>
18+
19+
<Console name="ConsoleAppender" target="SYSTEM_OUT">
20+
<PatternLayout pattern="%d{ISO8601} [%t] %-5p %c - %m%n"/>
21+
922
</Console>
1023

1124
</Appenders>
25+
1226
<Loggers>
13-
<Root level="DEBUG">
27+
<Root level="${env:LOG_LEVEL:-INFO}">
28+
<AppenderRef ref="${env:LOG_OUTPUT:-ConsoleAppender}"/>
1429
</Root>
15-
<!-- For compatibility reasons. All GeneXus Standard Classes log goes to standard output unless Logging Property is enabled -->
16-
<logger name="com.genexus" level="DEBUG" additivity="false">
17-
<AppenderRef ref="GeneXusDefaultLogger"/>
30+
<logger name="com.genexus" level="${env:LOG_LEVEL:-INFO}" additivity="false">
31+
<AppenderRef ref="${env:LOG_OUTPUT:-ConsoleAppender}"/>
32+
</logger>
33+
<!-- User custom Logging !-->
34+
<logger name="GeneXusUserLog" level="${env:LOG_LEVEL_USER:-ALL}" additivity="false">
35+
<AppenderRef ref="${env:LOG_OUTPUT:-ConsoleAppender}"/>
1836
</logger>
1937

2038
</Loggers>

java/pom.xml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,22 @@
4444
<artifactId>commons-collections4</artifactId>
4545
<version>4.1</version>
4646
</dependency>
47-
<dependency>
48-
<groupId>org.apache.logging.log4j</groupId>
49-
<artifactId>log4j-1.2-api</artifactId>
50-
<version>2.17.1</version>
51-
</dependency>
52-
<dependency>
47+
<dependency>
48+
<groupId>org.apache.logging.log4j</groupId>
49+
<artifactId>log4j-core</artifactId>
50+
<version>${log4j.version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.apache.logging.log4j</groupId>
54+
<artifactId>log4j-api</artifactId>
55+
<version>${log4j.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.apache.logging.log4j</groupId>
59+
<artifactId>log4j-1.2-api</artifactId>
60+
<version>${log4j.version}</version>
61+
</dependency>
62+
<dependency>
5363
<groupId>javax.ejb</groupId>
5464
<artifactId>ejb-api</artifactId>
5565
<version>3.0</version>
@@ -149,15 +159,20 @@
149159
</dependency>
150160
<dependency>
151161
<groupId>jakarta.ws.rs</groupId>
152-
<artifactId>jakarta.ws.rs-api</artifactId>
153-
<version>3.0.0</version>
162+
<artifactId>jakarta.ws.rs-api</artifactId>
163+
<version>3.0.0</version>
154164
</dependency>
155165
<dependency>
156-
<groupId>org.xerial</groupId>
157-
<artifactId>sqlite-jdbc</artifactId>
158-
<version>3.36.0.3</version>
159-
<scope>test</scope>
166+
<groupId>org.xerial</groupId>
167+
<artifactId>sqlite-jdbc</artifactId>
168+
<version>3.36.0.3</version>
169+
<scope>test</scope>
160170
</dependency>
171+
<dependency>
172+
<groupId>io.opentelemetry</groupId>
173+
<artifactId>opentelemetry-api</artifactId>
174+
<version>${io.opentelemetry.version}</version>
175+
</dependency>
161176
</dependencies>
162177

163178
<build>

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<junit.version>4.13.2</junit.version>
2727
<com.amazonaws.version>1.12.93</com.amazonaws.version>
2828
<software.awssdk.version>2.17.272</software.awssdk.version>
29+
<log4j.version>2.19.0</log4j.version>
30+
<io.opentelemetry.version>1.19.0</io.opentelemetry.version>
2931
</properties>
3032

3133
<organization>

wrappercommon/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<groupId>com.fasterxml.jackson.core</groupId>
2424
<artifactId>jackson-core</artifactId>
2525
<version>2.11.0</version>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.apache.logging.log4j</groupId>
29-
<artifactId>log4j-core</artifactId>
30-
<version>2.17.1</version>
3126
</dependency>
27+
<dependency>
28+
<groupId>org.apache.logging.log4j</groupId>
29+
<artifactId>log4j-core</artifactId>
30+
<version>${log4j.version}</version>
31+
</dependency>
3232
<dependency>
3333
<groupId>commons-io</groupId>
3434
<artifactId>commons-io</artifactId>

0 commit comments

Comments
 (0)