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
4 changes: 2 additions & 2 deletions log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<!-- `com.conversantmedia:disruptor` version 1.2.16 requires Java 9: -->
<conversant.disruptor.version>1.2.15</conversant.disruptor.version>
<disruptor.version>3.4.4</disruptor.version>
<elasticsearch-java.version>8.14.1</elasticsearch-java.version>
<elasticsearch-java.version>8.14.2</elasticsearch-java.version>
<embedded-ldap.version>0.9.0</embedded-ldap.version>
<felix.version>7.0.5</felix.version>
<flapdoodle-embed.version>4.12.0</flapdoodle-embed.version>
Expand Down Expand Up @@ -114,7 +114,7 @@
<jetty.version>9.4.55.v20240627</jetty.version>
<jmdns.version>3.5.9</jmdns.version>
<jmh.version>1.37</jmh.version>
<json-unit.version>2.39.0</json-unit.version>
<json-unit.version>2.40.0</json-unit.version>
<junit.version>4.13.2</junit.version>
<junit-jupiter.version>5.10.3</junit-jupiter.version>
<junit-pioneer.version>1.9.1</junit-pioneer.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="2657" link="https://github.com/apache/logging-log4j2/pull/2657"/>
<description format="asciidoc">Update `co.elastic.clients:elasticsearch-java` to version `8.14.1`</description>
<issue id="2711" link="https://github.com/apache/logging-log4j2/pull/2711"/>
<description format="asciidoc">Update `co.elastic.clients:elasticsearch-java` to version `8.14.2`</description>
</entry>
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="2701" link="https://github.com/apache/logging-log4j2/pull/2701"/>
<description format="asciidoc">Update `net.javacrumbs.json-unit:json-unit` to version `2.39.0`</description>
<issue id="2708" link="https://github.com/apache/logging-log4j2/pull/2708"/>
<description format="asciidoc">Update `net.javacrumbs.json-unit:json-unit` to version `2.40.0`</description>
</entry>
1 change: 1 addition & 0 deletions src/site/antora/antora.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ asciidoc:
project-id: "log4j"
java-target-version: "${maven.compiler.target}"
java-compiler-version: "${minimalJavaBuildVersion}"
log4j-kubernetes-url: "https://github.com/fabric8io/kubernetes-client/blob/main/doc/KubernetesLog4j.md"
logback-url: "https://logback.qos.ch"
logging-services-url: "https://logging.apache.org"
lmax-disruptor-url: "https://lmax-exchange.github.io/disruptor"
Expand Down
1 change: 1 addition & 0 deletions src/site/antora/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ asciidoc:
project-id: "log4j"
java-target-version: "8"
java-compiler-version: "[17,18)"
log4j-kubernetes-url: "https://github.com/fabric8io/kubernetes-client/blob/main/doc/KubernetesLog4j.md"
logback-url: "https://logback.qos.ch"
logging-services-url: "https://logging.apache.org"
lmax-disruptor-url: "https://lmax-exchange.github.io/disruptor"
Expand Down
24 changes: 24 additions & 0 deletions src/site/antora/modules/ROOT/examples/cloud/logstash/log4j2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Configuration": {
"Appenders": {
// tag::socketAppender[]
"Socket": {
"name": "SOCKET",
"host": "localhost",
"port": 12345,
"JsonTemplateLayout": {
"nullEventDelimiterEnabled": true
}
}
// end::socketAppender[]
},
"Loggers": {
"Root": {
"level": "WARN",
"AppenderRef": {
"ref": "SOCKET"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# 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.
#

# tag::socketAppender[]
appender.0.type = Socket
appender.0.name = SOCKET
appender.0.host = localhost
appender.0.port = 12345
appender.0.layout.type = JsonTemplateLayout
appender.0.layout.nullEventDelimiterEnabled = true
# end::socketAppender[]

rootLogger.level = WARN
rootLogger.appenderRef.0.ref = SOCKET
38 changes: 38 additions & 0 deletions src/site/antora/modules/ROOT/examples/cloud/logstash/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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-2.xsd">

<Appenders>
<!-- tag::socketAppender[] -->
<Socket name="SOCKET" host="localhost" port="12345">
<JsonTemplateLayout nullEventDelimiterEnabled="true"/>
</Socket>
<!-- end::socketAppender[] -->
</Appenders>

<Loggers>
<Root level="WARN">
<AppenderRef ref="SOCKET"/>
</Root>
</Loggers>

</Configuration>
33 changes: 33 additions & 0 deletions src/site/antora/modules/ROOT/examples/cloud/logstash/log4j2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# 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:
# tag::socketAppender[]
Socket:
name: "SOCKET"
host: "localhost"
port: 12345
JsonTemplateLayout:
nullEventDelimiterEnabled: true
# end::socketAppender[]

Loggers:
Root:
level: "WARN"
AppenderRef:
ref: "SOCKET"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Configuration": {
"monitorInterval": 10,
"Appenders": {
"Console": {
"name": "CONSOLE",
"JsonTemplateLayout": {}
}
},
"Loggers": {
"Root": {
"level": "ALL",
"AppenderRef": {
"ref": "CONSOLE"
}
}
},
// tag::filter[]
"ContextMapFilter": {
"operator": "AND",
"KeyValuePair": [
{
"key": "clientId",
"value": "1234"
},
{
"key": "userId",
"value": "alice"
},
{
"key": "userId",
"value": "bob"
}
]
}
// end::filter[]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# 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.
#
monitorInterval = 10

appender.0.type = Console
appender.0.name = CONSOLE
appender.0.layout.type = JsonTemplateLayout

rootLogger.level = ALL
rootLogger.appenderRef.0.ref = CONSOLE

# tag::filter[]
filter.0.type = ContextMapFilter
filter.0.operator = AND

filter.0.kv0.type = KeyValuePair
filter.0.kv0.key = clientId
filter.0.kv0.value = 1234

filter.0.kv1.type = KeyValuePair
filter.0.kv1.key = userId
filter.0.kv1.value = alice

filter.0.kv2.type = KeyValuePair
filter.0.kv2.key = userId
filter.0.kv2.value = bob
# end::filter[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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-2.xsd"
monitorInterval="10">
<Appenders>
<Console name="CONSOLE">
<JsonTemplateLayout/>
</Console>
</Appenders>
<Loggers>
<Root level="ALL">
<AppenderRef ref="CONSOLE"/>
</Root>
</Loggers>
<!-- tag::filter[] -->
<ContextMapFilter operator="AND">
<!-- tag::kvp[] -->
<KeyValuePair key="clientId" value="1234"/>
<KeyValuePair key="userId" value="alice"/>
<KeyValuePair key="userId" value="bob"/>
<!-- end::kvp[] -->
</ContextMapFilter>
<!-- end::filter[] -->
</Configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# 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:
monitorInterval: 10
Appenders:
Console:
name: "CONSOLE"
JsonTemplateLayout: { }
Loggers:
Root:
level: "ALL"
AppenderRef:
ref: "CONSOLE"
# tag::filter[]
ContextMapFilter:
operator: "AND"
KeyValuePair:
- key: "clientId"
value: "1234"
- key: "userId"
value: "alice"
- key: "userId"
value: "bob"
# end::filter[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"Configuration": {
"monitorInterval": 10,
"Appenders": {
"Console": {
"name": "CONSOLE",
"JsonTemplateLayout": {}
}
},
"Loggers": {
"Root": {
"level": "ALL",
"AppenderRef": {
"ref": "CONSOLE"
}
}
},
// tag::filter[]
"DynamicThresholdFilter": {
"key": "loginId", // <3>
"defaultThreshold": "ERROR",
"KeyValuePair": [
{ // <1>
"key": "alice",
"value": "DEBUG"
},
{ // <2>
"key": "bob",
"value": "INFO"
}
]
}
// end::filter[]
}
}
Loading