You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2022/08/15 13:16:07 UTC
[incubator-kyuubi] branch master updated: [KYUUBI #3157][DOC] Modify logging doc due to using log4j2 instead of log4j
This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new bbe7a4d78 [KYUUBI #3157][DOC] Modify logging doc due to using log4j2 instead of log4j
bbe7a4d78 is described below
commit bbe7a4d78c800e87b939a12f8492db64a45c1168
Author: zwangsheng <22...@qq.com>
AuthorDate: Mon Aug 15 21:15:56 2022 +0800
[KYUUBI #3157][DOC] Modify logging doc due to using log4j2 instead of log4j
### _Why are the changes needed?_
To close #3157
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [x] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #3224 from zwangsheng/issuse/3157.
Closes #3157
33225deb [zwangsheng] fix
b338a4a7 [zwangsheng] fix
d7ba40ad [zwangsheng] fix
Authored-by: zwangsheng <22...@qq.com>
Signed-off-by: Cheng Pan <ch...@apache.org>
---
docs/monitor/logging.md | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/docs/monitor/logging.md b/docs/monitor/logging.md
index 7493a790a..57c673c25 100644
--- a/docs/monitor/logging.md
+++ b/docs/monitor/logging.md
@@ -18,7 +18,7 @@
# Monitoring Kyuubi - Logging System
-Kyuubi uses [Apache Log4j](https://logging.apache.org/) for logging.
+Kyuubi uses [Apache Log4j2](https://logging.apache.org/log4j/2.x/) for logging since version v1.5.0. For versions v1.4.1 and below, it uses [Apache Log4j](https://logging.apache.org).
In general, there are mainly three components in the Kyuubi architecture that will produce component-oriented logs to help you trace breadcrumbs for SQL workloads against Kyuubi.
@@ -38,14 +38,14 @@ Logs of Kyuubi Server show us the activities of the server instance including ho
#### Basic Configurations
-You can configure it by adding a `log4j.properties` file in the `$KYUUBI_HOME/conf` directory.
-One way to start is to make a copy of the existing `log4j.properties.template` located there.
+You can configure it by adding a `log4j2.xml` file in the `$KYUUBI_HOME/conf` directory.
+One way to start is to make a copy of the existing `log4j2.xml.template` located there.
For example,
```shell
# cd $KYUUBI_HOME
-cp conf/log4j.properties.template conf/log4j.properties
+cp conf/log4j2.xml.template conf/log4j2.xml
```
With or without the above step, by default the server logging will redirect the logs to a file named `kyuubi-${env:USER}-org.apache.kyuubi.server.KyuubiServer-${env:HOSTNAME}.out` under the directory of `$KYUUBI_HOME/logs`.
@@ -105,20 +105,28 @@ Starting org.apache.kyuubi.server.KyuubiServer, logging to /Users/kentyao/tmp/ky
`KYUUBI_MAX_LOG_FILES` controls how many log files will be remained after a Kyuubi server reboots.
-#### Custom Log4j Settings
+#### Custom Log4j2 Settings
-Taking control of `$KYUUBI_HOME/conf/log4j.properties` will also give us the ability of customizing server logging as we want.
+Taking control of `$KYUUBI_HOME/conf/log4j2.xml` will also give us the ability of customizing server logging as we want.
For example, we can disable the console appender and enable the file appender like,
-```properties
-log4j.rootCategory=INFO, FA
-log4j.appender.FA=org.apache.log4j.FileAppender
-log4j.appender.FA.append=false
-log4j.appender.FA.file=log/dummy.log
-log4j.appender.FA.layout=org.apache.log4j.PatternLayout
-log4j.appender.FA.layout.ConversionPattern=%d{HH:mm:ss.SSS} %t %p %c{2}: %m%n
-log4j.appender.FA.Threshold=DEBUG
+```xml
+<Configuration status="INFO">
+ <Appenders>
+ <File name="fa" fileName="log/dummy.log">
+ <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c: %m%n"/>
+ <Filters>
+ <RegexFilter regex=".*Thrift error occurred during processing of message.*" onMatch="DENY" onMismatch="NEUTRAL"/>
+ </Filters>
+ </File>
+ </Appenders>
+ <Loggers>
+ <Root level="INFO">
+ <AppenderRef ref="fa"/>
+ </Root>
+ </Loggers>
+</Configuration>
```
Then everything goes to `log/dummy.log`.