Skip to content

Commit c1459aa

Browse files
committed
Merge branch 'doc/2.x/configuration' into 2.x
2 parents f1de65f + cd69a98 commit c1459aa

File tree

85 files changed

+4719
-3001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+4719
-3001
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"Configuration": {
3+
"Appenders": {
4+
"File": {
5+
"name": "MAIN",
6+
// tag::select[]
7+
"Select": {
8+
"SystemPropertyArbiter": { // <1>
9+
"propertyName": "env",
10+
"propertyValue": "dev",
11+
"PatternLayout": {}
12+
},
13+
"DefaultArbiter": { // <2>
14+
"JsonTemplateLayout": {}
15+
}
16+
}
17+
// end::select[]
18+
}
19+
},
20+
"Loggers": {
21+
"Root": {
22+
"level": "INFO",
23+
"AppenderRef": {
24+
"ref": "MAIN"
25+
}
26+
}
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
appender.0.type = File
18+
appender.0.name = MAIN
19+
# tag::select[]
20+
appender.0.select.type = Select
21+
22+
appender.0.select.0.type = SystemPropertyArbiter # <1>
23+
appender.0.select.0.propertyName = env
24+
appender.0.select.0.propertyValue = dev
25+
appender.0.select.0.layout.type = PatternLayout
26+
27+
appender.0.select.1.type = DefaultArbiter # <2>
28+
appender.0.select.1.layout.type = JsonTemplateLayout
29+
# end::select[]
30+
31+
rootLogger.level = INFO
32+
rootLogger.appenderRef.0.ref = MAIN
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to you under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
<Configuration xmlns="https://logging.apache.org/xml/ns"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="
21+
https://logging.apache.org/xml/ns
22+
https://logging.apache.org/xml/ns/log4j-config-2.xsd">
23+
<Appenders>
24+
<File name="MAIN" fileName="logs/app.log">
25+
<!-- tag::select[] -->
26+
<Select>
27+
<SystemPropertyArbiter propertyName="env" propertyValue="dev"> <!--1-->
28+
<PatternLayout/>
29+
</SystemPropertyArbiter>
30+
<DefaultArbiter> <!--2-->
31+
<JsonTemplateLayout/>
32+
</DefaultArbiter>
33+
</Select>
34+
<!-- end::select[] -->
35+
</File>
36+
</Appenders>
37+
<Loggers>
38+
<Root level="INFO">
39+
<AppenderRef ref="MAIN"/>
40+
</Root>
41+
</Loggers>
42+
</Configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
Configuration:
18+
Appenders:
19+
File:
20+
name: "MAIN"
21+
fileName: "logs/app.log"
22+
# tag::select[]
23+
Select:
24+
SystemPropertyArbiter: # <1>
25+
propertyName: "env"
26+
propertyValue: "dev"
27+
PatternLayout: {}
28+
DefaultArbiter: # <2>
29+
JsonTemplateLayout: {}
30+
# end::select[]
31+
Loggers:
32+
Root:
33+
level: "INFO"
34+
AppenderRef:
35+
ref: "MAIN"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"Configuration": {
3+
"Appenders": {
4+
"File": {
5+
"name": "MAIN",
6+
"SystemPropertyArbiter": [
7+
// <1>
8+
{
9+
"propertyName": "env",
10+
"propertyValue": "dev",
11+
"PatternLayout": {
12+
"pattern": "%d [%t] %p %c - %m%n"
13+
}
14+
},
15+
// <2>
16+
{
17+
"propertyName": "env",
18+
"propertyValue": "prod",
19+
"JsonTemplateLayout": {}
20+
}
21+
]
22+
}
23+
},
24+
"Loggers": {
25+
"Root": {
26+
"level": "INFO",
27+
"AppenderRef": {
28+
"ref": "MAIN"
29+
}
30+
}
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
appender.0.type = File
18+
appender.0.name = MAIN
19+
20+
appender.0.arbiter[0].type = SystemPropertyArbiter # <1>
21+
appender.0.arbiter[0].propertyName = env
22+
appender.0.arbiter[0].propertyValue = dev
23+
appender.0.arbiter[0].layout.type = PatternLayout
24+
appender.0.arbiter[0].layout.pattern = %d [%t] %p %c - %m%n
25+
26+
appender.0.arbiter[1].type = SystemPropertyArbiter # <2>
27+
appender.0.arbiter[1].propertyName = env
28+
appender.0.arbiter[1].propertyValue = prod
29+
appender.0.arbiter[1].layout.type = JsonTemplateLayout
30+
31+
rootLogger.level = INFO
32+
rootLogger.appenderRef.0.ref = MAIN
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to you under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
<Configuration xmlns="https://logging.apache.org/xml/ns"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="
21+
https://logging.apache.org/xml/ns
22+
https://logging.apache.org/xml/ns/log4j-config-2.xsd">
23+
<Appenders>
24+
<File name="MAIN" fileName="logs/app.log">
25+
<SystemPropertyArbiter propertyName="env" propertyValue="dev"> <!--1-->
26+
<PatternLayout pattern="%d [%t] %p %c - %m%n"/>
27+
</SystemPropertyArbiter>
28+
<SystemPropertyArbiter propertyName="env" propertyValue="prod"> <!--2-->
29+
<JsonTemplateLayout/>
30+
</SystemPropertyArbiter>
31+
</File>
32+
</Appenders>
33+
<Loggers>
34+
<Root level="INFO">
35+
<AppenderRef ref="MAIN"/>
36+
</Root>
37+
</Loggers>
38+
</Configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
Configuration:
18+
Appenders:
19+
File:
20+
name: "MAIN"
21+
fileName: "logs/app.log"
22+
SystemPropertyArbiter:
23+
- propertyName: "env" # <1>
24+
propertyValue: "dev"
25+
PatternLayout:
26+
pattern: "%d [%t] %p %c - %m%n"
27+
- propertyName: "env" # <2>
28+
propertyValue: "prod"
29+
JsonTemplateLayout: {}
30+
Loggers:
31+
Root:
32+
level: "INFO"
33+
AppenderRef:
34+
ref: "MAIN"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"Configuration": {
3+
"Appenders": {},
4+
"Loggers": {
5+
// tag::loggers[]
6+
"Root": {
7+
"Property": {
8+
"name": "client.address",
9+
"value": "$${web:request.remoteAddress}"
10+
}
11+
},
12+
"Logger": [
13+
{
14+
"name": "org.hibernate",
15+
"Property": {
16+
"subsystem": "Database"
17+
}
18+
},
19+
{
20+
"name": "io.netty",
21+
"Property": {
22+
"subsystem": "Networking"
23+
}
24+
}
25+
]
26+
// end::loggers[]
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
##
18+
# tag::loggers[]
19+
rootLogger.property.type = Property
20+
rootLogger.name = client.address
21+
rootLogger.value = $${web:request.remoteAddress}
22+
23+
logger.0.name = org.hibernate
24+
logger.0.property.type = Property
25+
logger.0.property.name = subsystem
26+
logger.0.property.value = Database
27+
28+
logger.1.name = io.netty
29+
logger.1.property.type = Property
30+
logger.1.property.name = subsystem
31+
logger.1.property.value = Networking
32+
# end::loggers[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to you under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
<Configuration xmlns="https://logging.apache.org/xml/ns"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="
21+
https://logging.apache.org/xml/ns
22+
https://logging.apache.org/xml/ns/log4j-config-2.xsd">
23+
<Appenders/>
24+
<Loggers>
25+
<!-- tag::loggers[] -->
26+
<Root>
27+
<Property name="client.address" value="$${web:request.remoteAddress}"/>
28+
</Root>
29+
<Logger name="org.hibernate">
30+
<Property name="subsystem" value="Database"/>
31+
</Logger>
32+
<Logger name="io.netty">
33+
<Property name="subsystem" value="Networking"/>
34+
</Logger>
35+
<!-- end::loggers[] -->
36+
</Loggers>
37+
</Configuration>

0 commit comments

Comments
 (0)