Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<commons-dbcp2.version>2.12.0</commons-dbcp2.version>
<commons-io.version>2.16.1</commons-io.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-logging.version>1.3.1</commons-logging.version>
<commons-logging.version>1.3.2</commons-logging.version>
<conversant.disruptor.version>1.2.21</conversant.disruptor.version>
<disruptor.version>4.0.0</disruptor.version>
<elasticsearch.version>7.17.21</elasticsearch.version>
Expand Down Expand Up @@ -138,11 +138,11 @@
<log4j2-ecs-layout.version>1.6.0</log4j2-ecs-layout.version>
<log4j2-logstash-layout.version>0.18</log4j2-logstash-layout.version>
<logback.version>1.4.14</logback.version>
<maven.version>3.9.6</maven.version>
<maven.version>3.9.7</maven.version>
<mockito.version>5.12.0</mockito.version>
<mongodb.version>5.1.0</mongodb.version>
<nashorn.version>15.4</nashorn.version>
<netty.version>4.1.109.Final</netty.version>
<netty.version>4.1.110.Final</netty.version>
<opentest4j.version>1.3.0</opentest4j.version>
<org.eclipse.osgi.version>3.19.0</org.eclipse.osgi.version>
<oro.version>2.0.8</oro.version>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
<!-- Skipping `maven-site-plugin` globally. -->
<maven.site.skip>true</maven.site.skip>
<maven.site.deploy.skip>true</maven.site.deploy.skip>
<site-commons-logging.version>1.3.1</site-commons-logging.version>
<site-commons-logging.version>1.3.2</site-commons-logging.version>
<site-log4j-core.version>3.0.0-beta2</site-log4j-core.version>
<site-log4j-layout-template-json.version>3.0.0-beta2</site-log4j-layout-template-json.version>
<site-logback.version>1.5.5</site-logback.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="2405" link="https://github.com/apache/logging-log4j2/pull/2405"/>
<description format="asciidoc">Update `commons-logging:commons-logging` to version `1.3.1`</description>
<issue id="2586" link="https://github.com/apache/logging-log4j2/pull/2586"/>
<description format="asciidoc">Update `commons-logging:commons-logging` to version `1.3.2`</description>
</entry>
4 changes: 2 additions & 2 deletions src/changelog/.3.x.x/update_io_netty_netty_bom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="2474" link="https://github.com/apache/logging-log4j2/pull/2474"/>
<description format="asciidoc">Update `io.netty:netty-bom` to version `4.1.109.Final`</description>
<issue id="2603" link="https://github.com/apache/logging-log4j2/pull/2603"/>
<description format="asciidoc">Update `io.netty:netty-bom` to version ``</description>
</entry>
8 changes: 8 additions & 0 deletions src/changelog/.3.x.x/update_org_apache_maven_maven_core.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="updated">
<issue id="2615" link="https://github.com/apache/logging-log4j2/pull/2615"/>
<description format="asciidoc">Update `org.apache.maven:maven-core` to version `3.9.7`</description>
</entry>
2 changes: 2 additions & 0 deletions src/site/antora/antora.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ asciidoc:
lmax-disruptor-url: "https://lmax-exchange.github.io/disruptor"
# Dependency versions
commons-logging-version: "${site-commons-logging.version}"
disruptor-version: "${site-disruptor.version}"
jackson-version: "${site-jackson.version}"
log4j-api-version: "${log4j-api.version}"
log4j-core-version: "${site-log4j-core.version}"
log4j-layout-template-json-version: "${site-log4j-layout-template-json.version}"
Expand Down
10 changes: 6 additions & 4 deletions src/site/antora/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ asciidoc:
project-github-url: "https://github.com/apache/logging-log4j2"
project-name: "Log4j"
project-id: "log4j"
java-target-version: "17"
java-target-version: "8"
java-compiler-version: "[17,18)"
logging-services-url: "https://logging.apache.org"
log4j2-url: "https://logging.apache.org/log4j/2.x"
lmax-disruptor-url: "https://lmax-exchange.github.io/disruptor"
# Dependency versions
commons-logging-version: "1.4.0"
commons-logging-version: "1.2.3-commons-logging"
disruptor-version: "1.2.3-disruptor"
jackson-version: "1.2.3-jackson"
log4j-api-version: "1.2.3-api"
log4j-core-version: "1.2.3-core"
log4j-layout-template-json-version: "1.2.3-layout-template-json"
logback-version: "1.5.12"
slf4j-version: "2.0.12"
logback-version: "1.2.3-logback"
slf4j-version: "1.2.3-slf4j"
nav:
- modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"Configuration": {
"Appenders": {
"Console": {
"name": "STDOUT",
"PatternLayout": {
"ScriptPatternSelector": {
"defaultPattern": "%d %p %m%n",
"ScriptRef": {
"ref": "SELECTOR_SCRIPT",
"PatternMatch": [
{
"key": "NoLocation",
"pattern": "[%-5level] %c{1.} %msg%n"
},
{
"key": "Flow",
"pattern": "[%-5level] %c{1.} ====== %C{1.}.%M:%L %msg ======%n"
}
]
}
}
}
},
"Loggers": {
"Logger": {
"name": "EventLogger",
"ScriptFilter": {
"onMatch": "ACCEPT",
"onMismatch": "DENY",
"Script": {
"name": "EVENT_LOGGER_FILTER",
"language": "groovy",
"scriptText": "if (logEvent.getMarker() != null && logEvent.getMarker().isInstanceOf('FLOW'))) { return true; } else if (logEvent.getContextMap().containsKey('UserId')) { return true; } return false;"
}
}
},
"Root": {
"level": "INFO",
"ScriptFilter": {
"onMatch": "ACCEPT",
"onMismatch": "DENY",
"ScriptRef": {
"ref": "ROOT_FILTER"
}
},
"AppenderRef": {
"ref": "STDOUT"
}
},
"Scripts": {
"Script": {
"name": "SELECTOR_SCRIPT",
"language": "javascript",
"scriptText": "var result; if (logEvent.getLoggerName().equals('JavascriptNoLocation')) { result = 'NoLocation'; } else if (logEvent.getMarker() != null && logEvent.getMarker().isInstanceOf('FLOW')) { result = 'Flow'; } result;"
},
"ScriptFile": {
"name": "ROOT_FILTER",
"path": "scripts/filter.groovy"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
appender.0.type = Console
appender.0.name = STDOUT
appender.0.layout.type = PatternLayout

appender.0.layout.selector = ScriptPatternSelector
appender.0.layout.selector.defaultPattern = %d %p %m%n
appender.0.layout.selector.scriptRef.type = ScriptRef
appender.0.layout.selector.scriptRef.ref = SELECTOR_SCRIPT
appender.0.layout.selector.match[0].type = PatternMatch
appender.0.layout.selector.match[0].key = NoLocation
appender.0.layout.selector.match[0].pattern = [%-5level] %c{1.} %msg%n
appender.0.layout.selector.match[1].type = PatternMatch
appender.0.layout.selector.match[1].key = Flow
appender.0.layout.selector.match[1].pattern = \
[%-5level] %c{1.} ====== %C{1.}.%M:%L %msg ======%n

logger.0.name = EventLogger
logger.0.filter.0.type = ScriptFilter
logger.0.filter.0.onMatch = ACCEPT
logger.0.filter.0.onMismatch = DENY
logger.0.filter.0.script.type = Script
logger.0.filter.0.script.name = EVENT_LOGGER_FILTER
logger.0.filter.0.script.language = groovy
logger.0.filter.0.script.scriptText = \
if (logEvent.getMarker() != null\
&& logEvent.getMarker().isInstanceOf("FLOW"))) {\
return true;\
} else if (logEvent.getContextMap().containsKey("UserId")) {\
return true;\
}\
return false;

rootLogger.level = INFO
rootLogger.filter.0.type = ScriptFilter
rootLogger.filter.0.onMatch = ACCEPT
rootLogger.filter.0.onMismatch = DENY
rootLogger.filter.0.scriptRef.type = ScriptRef
rootLogger.filter.0.scriptRef.ref = ROOT_FILTER
rootLogger.appenderRef.0.ref = STDOUT

script.0.type = Script
script.0.name = SELECTOR_SCRIPT
script.0.language = javascript
script.0.scriptText = \
var result;\
if (logEvent.getLoggerName().equals("JavascriptNoLocation")) {\
result = "NoLocation";\
} else if (logEvent.getMarker() != null\
&& logEvent.getMarker().isInstanceOf("FLOW")) {\
result = "Flow";\
}\
result;

script.1.type = ScriptFile
script.1.name = ROOT_FILTER
script.1.path = scripts/filter.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to you under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<Configuration xmlns="https://logging.apache.org/xml/ns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
https://logging.apache.org/xml/ns
https://logging.apache.org/xml/ns/log4j-config-3.xsd">
<Appenders>
<Console name="STDOUT">
<PatternLayout>
<ScriptPatternSelector defaultPattern="%d %p %m%n">
<ScriptRef ref="SELECTOR_SCRIPT"/>
<PatternMatch key="NoLocation" pattern="[%-5level] %c{1.} %msg%n"/>
<PatternMatch key="Flow"
pattern="[%-5level] %c{1.} ====== %C{1.}.%M:%L %msg ======%n"/>
</ScriptPatternSelector>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<Logger name="EventLogger">
<ScriptFilter onMatch="ACCEPT" onMismatch="DENY">
<Script name="EVENT_LOGGER_FILTER" language="groovy"><![CDATA[
if (logEvent.getMarker() != null
&& logEvent.getMarker().isInstanceOf("FLOW")) {
return true;
} else if (logEvent.getContextMap().containsKey("UserId")) {
return true;
}
return false;
]]>
</Script>
</ScriptFilter>
</Logger>
<Root level="INFO">
<ScriptFilter onMatch="ACCEPT" onMismatch="DENY">
<ScriptRef ref="ROOT_FILTER"/>
</ScriptFilter>
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
<Scripts>
<Script name="SELECTOR_SCRIPT" language="javascript"><![CDATA[
var result;
if (logEvent.getLoggerName().equals("JavascriptNoLocation")) {
result = "NoLocation";
} else if (logEvent.getMarker() != null
&& logEvent.getMarker().isInstanceOf("FLOW")) {
result = "Flow";
}
result;
]]>
</Script>
<ScriptFile name="ROOT_FILTER" path="scripts/filter.groovy"/>
</Scripts>
</Configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
Configuration:
Appenders:
Console:
name: "STDOUT"
PatternLayout:
ScriptPatternSelector:
defaultPattern: "%d %p %m%n"
ScriptRef:
ref: "SELECTOR_SCRIPT"
PatternMatch:
- key: "NoLocation"
pattern: "[%-5level] %c{1.} %msg%n"
- key: "Flow"
pattern: "[%-5level] %c{1.} ====== %C{1.}.%M:%L %msg ======%n"
Loggers:
Logger:
name: "EventLogger"
ScriptFilter:
onMatch: "ACCEPT"
onMismatch: "DENY"
Script:
name: "EVENT_LOGGER_FILTER"
language: "groovy"
scriptText: |
if (logEvent.getMarker() != null
&& logEvent.getMarker().isInstanceOf("FLOW")) {
return true;
} else if (logEvent.getContextMap().containsKey("UserId")) {
return true;
}
return false;
Root:
level: "INFO"
ScriptFilter:
onMatch: "ACCEPT"
onMismatch: "DENY"
ScriptRef:
ref: "ROOT_FILTER"
AppenderRef:
ref: "STDOUT"
Scripts:
Script:
name: "SELECTOR_SCRIPT"
language: "javascript"
scriptText: |
var result;
if (logEvent.getLoggerName().equals("JavascriptNoLocation")) {
result = "NoLocation";
} else if (logEvent.getMarker() != null
&& logEvent.getMarker().isInstanceOf("FLOW")) {
result = "Flow";
}
result;
ScriptFile:
name: "ROOT_FILTER"
path: "scripts/filter.groovy"
Loading