Skip to content

Commit

Permalink
GEODE-8250: Geode Logging doc changes (apache#5294)
Browse files Browse the repository at this point in the history
Co-authored-by: @kirklund
  • Loading branch information
davebarnes97 authored Jun 24, 2020
1 parent ca5d961 commit 210dc4f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
32 changes: 31 additions & 1 deletion geode-docs/managing/logging/configuring_log4j2.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,34 @@ Custom Log4j 2 configuration in <%=vars.product_name%> comes with some caveats a
```
You can enable the GEODE\_VERBOSE log statements by changing `onMatch="DENY"` to `onMatch="ACCEPT"`. Typically, it's more useful to simply enable DEBUG or TRACE on certain classes or packages instead of for the entire <%=vars.product_name%> product. However, this setting can be used for internal debugging purposes if all other debugging methods fail.
- The usage of filters can have an impact on performance. <%=vars.product_name%> has some logging optimizations that are deactivated when filters are used (except for the GEODE_VERBOSE marker mentioned previously).
- The usage of filters can have an impact on performance. <%=vars.product_name%> has some logging optimizations that are deactivated when filters are used (except for the GEODE_VERBOSE marker mentioned previously).

- Geode's custom Log4j 2 Appenders can be used in a custom log4j2.xml. This requires:

1. Specify "org.apache.geode" in the packages attribute of Configuration to enable Log4j 2 to find and use Geode classes:

```xml
<Configuration status="WARN" shutdownHook="disable" packages="org.apache.geode">
```

2. Specify GeodeConsole, GeodeLogWriter, and/or GeodeAlert in the Appenders section:

```xml
<Properties>
<Property name="geode-pattern">[%level{lowerCase=true} %date{yyyy/MM/dd HH:mm:ss.SSS z} &lt;%thread&gt; tid=%hexTid] %message%n%throwable%n</Property>
</Properties>

<Appenders>
<GeodeConsole name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="${geode-pattern}"/>
</GeodeConsole>
<GeodeLogWriter name="LOGWRITER">
<PatternLayout pattern="${geode-pattern}"/>
</GeodeLogWriter>
<GeodeAlert name="ALERT"/>
</Appenders>
```

(Note that GeodeAlert does not use a PatternLayout)

3. See the default `log4j2.xml` in the Geode source directory `geode-log4j/src/main/resources/` as a reference for creating a custom configuration.
2 changes: 1 addition & 1 deletion geode-docs/managing/logging/how_logging_works.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.

<%=vars.product_name_long%> uses Apache Log4j 2 as the basis for its logging system.
<%=vars.product_name%> uses [Apache Log4j 2](http://logging.apache.org/log4j/2.x/) API and Core libraries as the basis for its logging system. Log4j 2 API is a popular and powerful front-end logging API used by all the <%=vars.product_name%> classes to generate log statements. Log4j 2 Core is a backend implementation for logging; you can route any of the front-end logging API libraries to log to this backend. <%=vars.product_name%> uses the Core backend to run two custom Log4j 2 Appenders: **AlertAppender** and **LogWriterAppender**.
<%=vars.product_name%> uses [Apache Log4j 2](http://logging.apache.org/log4j/2.x/) API and Core libraries as the basis for its logging system. Log4j 2 API is a popular and powerful front-end logging API used by all the <%=vars.product_name%> classes to generate log statements. Log4j 2 Core is a backend implementation for logging; you can route any of the front-end logging API libraries to log to this backend. <%=vars.product_name%> uses the Core backend to run three custom Log4j 2 Appenders: **GeodeConsole**, **GeodeLogWriter**, and **GeodeAlert**.
<%=vars.product_name%> has been tested with Log4j 2.12.
<%=vars.product_name%> requires the
Expand Down

0 comments on commit 210dc4f

Please sign in to comment.