Skip to content

Commit

Permalink
[Java] Add a default config file for log4j2. (ray-project#23225)
Browse files Browse the repository at this point in the history
We add a default config file for java worker to make info logs are able to be printed before `Ray.init()` invoked.
  • Loading branch information
jovany-wang committed Mar 17, 2022
1 parent f33a495 commit 9f3b492
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions java/runtime/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--NOTE: This configuration file is important, we shouldn't remove it.
In log4j2, if we don't specify the log level, the default value is error.
In our case that if we logged before `Ray.init()`, the logs will not printed.
-->
<Configuration status="info" name="RayDefaultLog4j2ConfigBeforeInit">
<ThresholdFilter level="debug"/>

<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %p %c{1} [%t]: %m%n"/>
<ThresholdFilter level="debug"/>
</Console>
</Appenders>

<Loggers>
<Root level="info">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>

</Configuration>

0 comments on commit 9f3b492

Please sign in to comment.