-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Revamp the Lookups
page
#2736
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
Merged
Merged
Revamp the Lookups
page
#2736
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
151f7a6
Revamp the `Lookups` page
ppkarwasz 5e9cf97
Delete `@Test` annotation from non-JUnit class
ppkarwasz 61611d9
Reformat with one-line-per-sentence
ppkarwasz c3a1704
Apply suggestions from code review
ppkarwasz fd9f75e
Apply suggestions from code review (2)
ppkarwasz c5704e2
Apply suggestions from code review (3)
ppkarwasz 8e42f78
Fix capitalization of `Lookup` word
ppkarwasz b63461d
Merge `Lookup ID` and `Key format`
ppkarwasz d613928
Add note about lazy lookups in `PatternLayout`
ppkarwasz b168e2e
Apply suggestions from code review (4)
ppkarwasz bbba020
Convert bullet list to definition list
ppkarwasz 4b5dcc3
Merge remote-tracking branch 'apache/2.x' into doc/2.x/lookups
ppkarwasz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/site/antora/modules/ROOT/examples/manual/lookups/MainArgsExample.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* 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. | ||
*/ | ||
package example; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
public final class MainArgsExample implements Runnable { | ||
|
||
// tag::usage[] | ||
private final Logger logger = LogManager.getLogger(); // <1> | ||
|
||
public static void main(final String[] args) { | ||
try { // <2> | ||
Class.forName("org.apache.logging.log4j.core.lookup.MainMapLookup") | ||
.getDeclaredMethod("setMainArguments", String[].class) | ||
.invoke(null, (Object) args); | ||
} catch (final ReflectiveOperationException e) { | ||
// Log4j Core is not used. | ||
} | ||
new MainArgsExample().run(); | ||
} | ||
// end::usage[] | ||
|
||
@Override | ||
public void run() { | ||
logger.info("Hello `main` lookup!"); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/site/antora/modules/ROOT/examples/manual/lookups/mainArgs.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"Configuration": { | ||
"Properties": { | ||
"Property": [ // <1> | ||
{ | ||
"name": "--logfile", | ||
"value": "logs/app.log" | ||
}, | ||
{ | ||
"name": "--loglevel", | ||
"value": "INFO" | ||
} | ||
] | ||
}, | ||
"Appenders": { | ||
"File": { | ||
"fileName": "${main:\\--logfile}", // <2> | ||
"name": "FILE", | ||
"JsonTemplateLayout": {} | ||
} | ||
}, | ||
"Loggers": { | ||
"Root": { | ||
"level": "${main:\\--loglevel", // <2> | ||
"AppenderRef": { | ||
"ref": "FILE" | ||
} | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/site/antora/modules/ROOT/examples/manual/lookups/mainArgs.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# | ||
# 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. | ||
# | ||
## | ||
# <1> | ||
property.--logfile = logs/app.log | ||
property.--loglevel = INFO | ||
|
||
appender.0.type = File | ||
# <2> | ||
appender.0.fileName = ${main:\\--logfile} | ||
appender.0.name = FILE | ||
|
||
# <2> | ||
rootLogger.level = ${main:\\--loglevel} | ||
rootLogger.appenderRef.0.ref = FILE |
36 changes: 36 additions & 0 deletions
36
src/site/antora/modules/ROOT/examples/manual/lookups/mainArgs.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> | ||
<Properties> <!--1--> | ||
<Property name="--logfile" value="logs/app.log"/> | ||
<Property name="--loglevel" value="INFO"/> | ||
</Properties> | ||
<Appenders> | ||
<File fileName="${main:\--logfile}" | ||
name="FILE"/> <!--2--> | ||
</Appenders> | ||
<Loggers> | ||
<Root level="${main:\--loglevel}"> <!--2--> | ||
<AppenderRef ref="FILE"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
33 changes: 33 additions & 0 deletions
33
src/site/antora/modules/ROOT/examples/manual/lookups/mainArgs.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
Properties: # <1> | ||
Property: | ||
- name: "--logfile" | ||
value: "logs/app.log" | ||
- name: "--loglevel" | ||
value: "INFO" | ||
Appenders: | ||
File: | ||
fileName: "${main:\\--logfile}" # <2> | ||
name: "FILE" | ||
JsonTemplateLayout: {} | ||
Loggers: | ||
Root: | ||
level: "${main:\\--loglevel}" # <2> | ||
AppenderRef: | ||
ref: "FILE" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.