Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp Configuration page #2574

Merged
merged 24 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
47ce519
New configuration page
ppkarwasz Apr 30, 2024
f6c6308
Revamp configuration page
ppkarwasz May 10, 2024
553dd7b
Move configuration properties to separate page
ppkarwasz May 10, 2024
a330c6b
Add arbiters and scripts
ppkarwasz May 12, 2024
1d1a69c
Move scripts to a separate file
ppkarwasz May 12, 2024
c84f0a5
Exclude Antora examples from RAT configuration
ppkarwasz May 12, 2024
78cfcd3
Add headers to example files
ppkarwasz May 12, 2024
5f8e0ae
Proofreading
ppkarwasz May 13, 2024
cd8a617
grammar, typos, some rewording
grobmeier May 13, 2024
ced35ab
tiny improvements on wording
grobmeier May 13, 2024
f797fcb
Apply suggestions from code review
ppkarwasz May 14, 2024
d55b35a
Simplify arbiters-select example
ppkarwasz May 14, 2024
1c61b03
Wrap `schemaLocation` attribute
ppkarwasz May 14, 2024
fcacdee
Remove attribute with default value
ppkarwasz May 14, 2024
76bb04f
YAML formatting
ppkarwasz May 14, 2024
01ef75c
Fix reference naming
ppkarwasz May 14, 2024
7195861
Miscellaneous fixes
ppkarwasz May 14, 2024
a786e62
Paragraph formatting problems
ppkarwasz May 14, 2024
61c2c6f
tiny wording/spelling improvements
grobmeier May 14, 2024
e84a46c
tiny wording improvments and corrections
grobmeier May 14, 2024
be54ca2
Apply suggestions from code review (2)
ppkarwasz May 15, 2024
5f8a7dc
Add logger configuration example
ppkarwasz May 15, 2024
cd69a98
Add property expansion example
ppkarwasz May 15, 2024
7e873f3
some active/passive changes, wording and general style. No content ch…
grobmeier May 15, 2024
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
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Configuration": {
"Appenders": {
"File": {
"name": "MAIN",
"Select": {
"SystemPropertyArbiter": { // <1>
"propertyName": "env",
"propertyValue": "dev",
"PatternLayout": {
"pattern": "%d [%t] %p %c - %m%n"
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
}
},
"DefaultArbiter": { // <2>
"JsonTemplateLayout": {}
}
}
}
},
"Loggers": {
"Root": {
"level": "INFO",
"AppenderRef": {
"ref": "MAIN"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# 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 = File
appender.0.name = MAIN
appender.0.select.type = Select

appender.0.select.0.type = SystemPropertyArbiter # <1>
appender.0.select.0.propertyName = env
appender.0.select.0.propertyValue = dev
appender.0.select.0.layout.type = PatternLayout
appender.0.select.0.layout.pattern = %d [%t] %p %c - %m%n

appender.0.select.1.type = DefaultArbiter # <2>
appender.0.select.1.layout.type = JsonTemplateLayout

rootLogger.level = INFO
rootLogger.appenderRef.0.ref = MAIN
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>
<File name="MAIN" fileName="logs/app.log">
<Select>
<SystemPropertyArbiter propertyName="env" propertyValue="dev"> <!--1-->
<PatternLayout pattern="%d [%t] %p %c - %m%n"/>
</SystemPropertyArbiter>
<DefaultArbiter> <!--2-->
<JsonTemplateLayout/>
</DefaultArbiter>
</Select>
</File>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="MAIN"/>
</Root>
</Loggers>
</Configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# 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:
File:
name: "MAIN"
fileName: "logs/app.log"
Select:
SystemPropertyArbiter: # <1>
propertyName: "env"
propertyValue: "dev"
PatternLayout:
pattern: "%d [%t] %p %c - %m%n"
DefaultArbiter: # <2>
JsonTemplateLayout: { }
Loggers:
Root:
level: "INFO"
AppenderRef:
ref: "MAIN"
33 changes: 33 additions & 0 deletions src/site/antora/modules/ROOT/examples/configuration/arbiters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Configuration": {
"Appenders": {
"File": {
"name": "MAIN",
"SystemPropertyArbiter": [
// <1>
{
"propertyName": "env",
"propertyValue": "dev",
"PatternLayout": {
"pattern": "%d [%t] %p %c - %m%n"
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
}
},
// <2>
{
"propertyName": "env",
"propertyValue": "prod",
"JsonTemplateLayout": {}
}
]
}
},
"Loggers": {
"Root": {
"level": "INFO",
"AppenderRef": {
"ref": "MAIN"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# 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 = File
appender.0.name = MAIN

appender.0.arbiter[0].type = SystemPropertyArbiter # <1>
appender.0.arbiter[0].propertyName = env
appender.0.arbiter[0].propertyValue = dev
appender.0.arbiter[0].layout.type = PatternLayout
appender.0.arbiter[0].layout.pattern = %d [%t] %p %c - %m%n

appender.0.arbiter[1].type = SystemPropertyArbiter # <2>
appender.0.arbiter[1].propertyName = env
appender.0.arbiter[1].propertyValue = prod
appender.0.arbiter[1].layout.type = JsonTemplateLayout

rootLogger.level = INFO
rootLogger.appenderRef.0.ref = MAIN
36 changes: 36 additions & 0 deletions src/site/antora/modules/ROOT/examples/configuration/arbiters.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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>
<File name="MAIN" fileName="logs/app.log">
<SystemPropertyArbiter propertyName="env" propertyValue="dev"> <!--1-->
<PatternLayout pattern="%d [%t] %p %c - %m%n"/>
</SystemPropertyArbiter>
<SystemPropertyArbiter propertyName="env" propertyValue="prod"> <!--2-->
<JsonTemplateLayout/>
</SystemPropertyArbiter>
</File>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="MAIN"/>
</Root>
</Loggers>
</Configuration>
34 changes: 34 additions & 0 deletions src/site/antora/modules/ROOT/examples/configuration/arbiters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# 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:
File:
name: "MAIN"
fileName: "logs/app.log"
SystemPropertyArbiter:
- propertyName: "env" # <1>
propertyValue: "dev"
PatternLayout:
pattern: "%d [%t] %p %c - %m%n"
- propertyName: "env" # <2>
propertyValue: "prod"
JsonTemplateLayout: { }
Loggers:
Root:
level: "INFO"
AppenderRef:
ref: "MAIN"
37 changes: 37 additions & 0 deletions src/site/antora/modules/ROOT/examples/configuration/filters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"Configuration": {
"Appenders": {
"Console": {
"name": "CONSOLE",
"ThresholdFilter": {
"level": "WARN" // <6>
}
}
},
"Loggers": {
"Root": {
"level": "INFO",
"ThresholdFilter": { // <3>
"level": "DEBUG"
},
"AppenderRef": {
"ref": "CONSOLE",
"level": "WARN", // <5>
"MarkerFilter": { // <4>
"marker": "ALERT",
"onMatch": "NEUTRAL",
"onMismatch": "DENY"
}
}
},
"Logger": {
"name": "org.example",
"level": "TRACE" // <2>
}
}
},
"MarkerFilter": { // <1>
"marker": "PRIVATE",
"onMismatch": "NEUTRAL"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# 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 = CONSOLE
appender.0.filter.type = ThresholdFilter # <6>
appender.0.filter.level = WARN

rootLogger.level = INFO
rootLogger.filter.type = ThresholdFilter # <3>
rootLogger.filter.level = DEBUG
rootLogger.appenderRef.0.ref = CONSOLE
rootLogger.appenderRef.0.level = WARN # <5>
rootLogger.appenderRef.0.filter.type = MarkerFilter # <4>
rootLogger.appenderRef.0.filter.marker = ALERT
rootLogger.appenderRef.0.filter.onMatch = NEUTRAL
rootLogger.appenderRef.0.filter.onMismatch = DENY

logger.0.name = org.example
logger.0.level = DEBUG # <2>
logger.0.filter.type = ThresholdFilter # <3>
logger.0.filter.level = TRACE

filter.type = MarkerFilter # <1>
filter.marker = PRIVATE
filter.onMismatch = NEUTRAL
40 changes: 40 additions & 0 deletions src/site/antora/modules/ROOT/examples/configuration/filters.xml
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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">
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
<Appenders>
<Console name="CONSOLE">
<ThresholdFilter level="WARN"/> <!--6-->
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<ThresholdFilter level="DEBUG"/> <!--3-->
<AppenderRef ref="CONSOLE" level="WARN"> <!--5-->
<MarkerFilter marker="ALERT"
onMatch="NEUTRAL"
onMismatch="DENY"/> <!--4-->
</AppenderRef>
</Root>
<Logger name="org.example" level="TRACE"> <!--2-->
<ThresholdFilter level="TRACE"/> <!--3-->
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
</Logger>
</Loggers>
<MarkerFilter marker="PRIVATE" onMismatch="NEUTRAL"/> <!--1-->
ppkarwasz marked this conversation as resolved.
Show resolved Hide resolved
</Configuration>
Loading