-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Revamp the Web Applications
page
#2692
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
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
ee07dc3
Revamp JTL page
vy 439d206
Revamp JTL page
vy 454c421
Move Pattern Layout to a separate page
vy f3879ab
Rewrite layouts in `layouts.adoc`
vy 3150d81
Merge remote-tracking branch 'origin/2.x' into doc/2.x/layouts
vy 631dbe4
Small adjustments
vy 74a6ae4
Improve wording on UTF-8 default
vy f67176a
Improve wording
vy 78330f0
Apply suggestions from code review
vy d651754
Merge remote-tracking branch 'origin/doc/2.x/layouts' into doc/2.x/la…
vy b95d668
Explain `PatternLayout` documentation notation
vy 76f77b5
Remove incorrectly documented `%m{lookups}`
vy f77b5c0
Fix Pattern Layout gc-free lookups docs
vy c5f0126
Fix garbage-free notes about lookups for PL and JTL
vy 0cf6c34
Add plugin ref links
vy f9deaaf
Move extending appenders/filters/lookups to their own pages
vy 08d942b
Improve extending layouts
vy 3c20113
Merge remote-tracking branch 'origin/2.x' into doc/2.x/extending
vy d495947
Rewrite `plugins.adoc`
vy 65b9924
Merge remote-tracking branch 'origin/2.x' into doc/2.x/extending
vy fc1953b
Merge remote-tracking branch 'origin/2.x' into doc/2.x/extending
vy e5b8161
Revamp `extending.adoc`
vy 34eb9f0
Rewrite architecture page and several other affected pages
vy df1813d
Merge remote-tracking branch 'origin/2.x' into doc/2.x/extending
vy defb250
Merge remote-tracking branch 'origin/2.x' into doc/2.x/extending
vy e4c028b
Replace Ditaa with PlantUML
vy 4e18097
Revamp the `Web Applications` page (part 1)
ppkarwasz c6dce1f
Add JSP documentation
ppkarwasz 3d2feab
Fix RAT failure
ppkarwasz 4c7414c
Add information about reconfiguration
ppkarwasz ae730af
Add and extend `log4j-appserver.adoc` and `logsep.adoc`
ppkarwasz bb50f07
Merge remote-tracking branch 'apache/doc/2.x/extending' into doc/2.x/…
ppkarwasz 0c6eee7
Fix broken links
ppkarwasz 353bb86
Merge remote-tracking branch 'apache/2.x' into doc/2.x/webapp
ppkarwasz d0a26f2
Add link to Payara (CE) classloading documentation
ppkarwasz 71fbef6
Move `ConfigurationFactory` to `configuration.adoc`
vy dd7d8bc
Rewrite programmatic configuration
vy 136506e
Merge remote-tracking branch 'origin/2.x' into doc/2.x/extending
vy f8a5534
Place `Reconfiguration reliability` under `Configuration`
vy 0a09e70
Advise against programmatically modifying components
vy b690448
Fix Spotless failures
vy df9ee62
Remove incorrectly placed `Filters` section in `configuration.adoc`
vy cbbe196
Improve wording
vy e2a2168
Improve wording
vy def1d8f
Fix `ExampleConfigurationFactory` method overload
vy b950f88
Remove the mention of `type-safe`
vy cd56f42
Fix explanation on `Configurator.initialize()`
vy 6399dbe
Fix explanation on `ConfigurationFactory` ordering
vy d1149f0
Fixing HTTP redirects based on fragments
vy c3e71b4
Fix `@Order` in `ExampleConfigurationFactory`
vy 725352e
Apply suggestions from code review
ppkarwasz 457bbd8
Apply review suggestions (2)
ppkarwasz 6ad209e
Apply IDEA suggestions
ppkarwasz 9104177
Reword global approach to logging
ppkarwasz 2809eaa
Apply review suggestions (3)
ppkarwasz 0338ead
Apply review suggestions (4)
ppkarwasz a44fe6c
Improve wording on `Usage#loadConfigurationFile()` example
vy 43f84a7
Improve `LoggerContextFactory` explanations
vy 8fd4b7e
Improve message factory documentation on placeholders
vy e505c16
Improve wording
vy 242a7ed
Remove the mention of `elementType`
vy be4b992
Fix code typo
vy 0b8c835
Explain which class loader is used
vy 7985ea2
Merge branch 'doc/2.x/extending' into doc/2.x/webapp
vy 9046907
Merge remote-tracking branch 'origin/2.x' into doc/2.x/webapp
vy 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
23 changes: 23 additions & 0 deletions
23
src/site/antora/modules/ROOT/examples/manual/appenders/servlet-appender.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,23 @@ | ||
{ | ||
"Configuration": { | ||
"Appenders": { | ||
// tag::servlet[] | ||
"Servlet": { | ||
"name": "SERVLET", | ||
"PatternLayout": { | ||
"pattern": "%m%n", | ||
"alwaysWriteExceptions": false // <1> | ||
} | ||
} | ||
// end::servlet[] | ||
}, | ||
"Loggers": { | ||
"Root": { | ||
"level": "INFO", | ||
"AppenderRef": { | ||
"ref": "SERVLET" | ||
} | ||
} | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/site/antora/modules/ROOT/examples/manual/appenders/servlet-appender.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,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::servlet[] | ||
appender.0.type = Servlet | ||
appender.0.name = SERVLET | ||
appender.0.layout.type = PatternLayout | ||
appender.0.layout.pattern = %m%n | ||
# <1> | ||
appender.0.layout.alwaysWriteExceptions = false | ||
# end::servlet[] | ||
|
||
rootLogger.level = INFO | ||
rootLogger.appenderRef.0.ref = SERVLET |
34 changes: 34 additions & 0 deletions
34
src/site/antora/modules/ROOT/examples/manual/appenders/servlet-appender.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,34 @@ | ||
<?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::servlet[] --> | ||
<Servlet name="SERVLET"> | ||
<PatternLayout pattern="%m%n" alwaysWriteExceptions="false"/> <!--1--> | ||
</Servlet> | ||
<!-- end::servlet[] --> | ||
</Appenders> | ||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="SERVLET"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
30 changes: 30 additions & 0 deletions
30
src/site/antora/modules/ROOT/examples/manual/appenders/servlet-appender.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,30 @@ | ||
# | ||
# 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::servlet[] | ||
Servlet: | ||
name: "SERVLET" | ||
PatternLayout: | ||
pattern: "%m%n" | ||
alwaysWriteExceptions: false # <1> | ||
# end::servlet[] | ||
Loggers: | ||
Root: | ||
level: "INFO" | ||
AppenderRef: | ||
ref: "SERVLET" |
59 changes: 59 additions & 0 deletions
59
src/site/antora/modules/ROOT/examples/manual/webapp/AsyncServlet.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,59 @@ | ||
/* | ||
* 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 javax.servlet.AsyncContext; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.apache.logging.log4j.web.Log4jWebSupport; | ||
import org.apache.logging.log4j.web.WebLoggerContextUtils; | ||
|
||
@WebServlet(urlPatterns = "/async/*", asyncSupported = true) | ||
public class AsyncServlet extends HttpServlet { | ||
|
||
private final Logger logger = LogManager.getLogger(); | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) { | ||
// tag::manual[] | ||
AsyncContext asyncContext = req.startAsync(); | ||
Log4jWebSupport webSupport = WebLoggerContextUtils.getWebLifeCycle(getServletContext()); | ||
asyncContext.start(() -> { | ||
try { | ||
webSupport.setLoggerContext(); | ||
// Put your logic here | ||
} finally { | ||
webSupport.clearLoggerContext(); | ||
} | ||
}); | ||
// end::manual[] | ||
} | ||
|
||
@Override | ||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) { | ||
// tag::automatic[] | ||
AsyncContext asyncContext = req.startAsync(); | ||
asyncContext.start(WebLoggerContextUtils.wrapExecutionContext(getServletContext(), () -> { | ||
// Put your logic here | ||
})); | ||
// end::automatic[] | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/site/antora/modules/ROOT/examples/manual/webapp/jndi.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,37 @@ | ||
<?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. | ||
--> | ||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" | ||
version="5.0"> | ||
<!-- tag::jndi[] --> | ||
<context-param> | ||
<param-name>isLog4jContextSelectorNamed</param-name> | ||
<param-value>true</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>log4jContextName</param-name> | ||
<param-value>your_application_name</param-value> | ||
</context-param> | ||
<env-entry> | ||
<env-entry-name>log4j/context-name</env-entry-name> | ||
<env-entry-value>your_application_name</env-entry-value> | ||
<env-entry-type>java.lang.String</env-entry-type> | ||
</env-entry> | ||
<!-- end::jndi[] --> | ||
</web-app> |
48 changes: 48 additions & 0 deletions
48
src/site/antora/modules/ROOT/examples/manual/webapp/log4j2-single.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,48 @@ | ||
{ | ||
"Configuration": { | ||
"Appenders": { | ||
// tag::global[] | ||
"File": { | ||
"name": "GLOBAL", | ||
"fileName": "logs/global.log", | ||
"JsonTemplateLayout": { | ||
"EventTemplateAdditionalField": { | ||
"key": "contextName", | ||
"value": "$${web:contextName}" | ||
} | ||
} | ||
}, | ||
// end::global[] | ||
// tag::routing[] | ||
"Routing": { | ||
"name": "ROUTING", | ||
"Routes": { | ||
"pattern": "$${web:contextName:-common}", | ||
"Route": { | ||
"File": { | ||
"name": "${web:contextName:-common}", | ||
"fileName": "logs/${web:contextName:-common}.log", | ||
"PatternLayout": { | ||
"pattern": "d [%t] %-5p %c - %m%n" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
// end::routing[] | ||
}, | ||
"Loggers": { | ||
"Route": { | ||
"level": "INFO", | ||
"AppenderRef": [ | ||
{ | ||
"ref": "GLOBAL" | ||
}, | ||
{ | ||
"ref": "ROUTING" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/site/antora/modules/ROOT/examples/manual/webapp/log4j2-single.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,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. | ||
# | ||
## | ||
# tag::global[] | ||
appender.0.type = File | ||
appender.0.name = GLOBAL | ||
appender.0.fileName = logs/global | ||
appender.0.layout.type = JsonTemplateLayout | ||
appender.0.layout.0.type = EventTemplateAdditionalField | ||
appender.0.layout.0.key = contextName | ||
appender.0.layout.0.value = $${web:contextName} | ||
# end::global[] | ||
# tag::routing[] | ||
appender.1.type = Routing | ||
appender.1.name = ROUTING | ||
appender.1.route.type = Routes | ||
appender.1.route.pattern = $${web:contextName:-common} | ||
appender.1.route.0.type = Route | ||
appender.1.route.0.appender.type = File | ||
appender.1.route.0.appender.name = ${web:contextName:-common} | ||
appender.1.route.0.appender.fileName = logs/${web:contextName:-common}.log | ||
appender.1.route.0.appender.layout.type = PatternLayout | ||
appender.1.route.0.appender.layout.pattern = %d [%t] %-5p %c - %m%n | ||
# end::routing[] | ||
rootLogger.level = INFO | ||
rootLogger.appenderRef.0.ref = GLOBAL | ||
rootLogger.appenderRef.1.ref = ROUTING |
49 changes: 49 additions & 0 deletions
49
src/site/antora/modules/ROOT/examples/manual/webapp/log4j2-single.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,49 @@ | ||
<?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::global[] --> | ||
<File name="GLOBAL" fileName="logs/global.log"> | ||
<JsonTemplateLayout> | ||
<EventTemplateAdditionalField key="contextName" | ||
value="$${web:contextName}"/> | ||
</JsonTemplateLayout> | ||
</File> | ||
<!-- end::global[] --> | ||
<!-- tag::routing[] --> | ||
<Routing name="ROUTING"> | ||
<Routes pattern="$${web:contextName:-common}"> | ||
<Route> | ||
<File name="${web:contextName:-common}" | ||
fileName="logs/${web:contextName:-common}.log"> | ||
<PatternLayout pattern="%d [%t] %-5p %c - %m%n"/> | ||
</File> | ||
</Route> | ||
</Routes> | ||
</Routing> | ||
<!-- end::routing[] --> | ||
</Appenders> | ||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="GLOBAL"/> | ||
<AppenderRef ref="ROUTING"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
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.