Skip to content

Commit 73c0c98

Browse files
garlandz-dblennartkats-dbNiranjan
authored
Default logging to System.out not System.err (#74)
Currently libraries that log to info are actually directed to System.err by default. This PR fixes it to instead go to [info] instead of [error] when running `sbt run` ``` [info] welcome to sbt 1.10.11 (Homebrew Java 17.0.14) [info] loading global plugins from /Users/garland.zhang/.sbt/1.0/plugins [info] loading settings for project fix_logging-build from plugins.sbt... [info] loading project definition from /Users/garland.zhang/tmp/fix_logging/project [info] loading settings for project fix_logging from build.sbt... [info] set current project to fix_logging (in build file:/Users/garland.zhang/tmp/fix_logging/) [info] compiling 1 Scala source to /Users/garland.zhang/tmp/fix_logging/target/scala-2.12/classes ... [info] running (fork) com.examples.Main [info] Hello, World! [info] Running outside Databricks [info] [main] INFO Debug mode disabled. Enable with the VM option -Darrow.memory.debug.allocator=true. [info] [main] INFO allocation manager type not specified, using netty as the default type [info] [main] INFO Using DefaultAllocationManager at memory/DefaultAllocationManagerFactory.class [info] [grpc-default-executor-0] INFO Trying pat auth ``` --------- Co-authored-by: Lennart Kats (databricks) <lennart.kats@databricks.com> Co-authored-by: Niranjan <nija@databricks.com>
1 parent 1c6b057 commit 73c0c98

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

contrib/templates/scala-job/template/{{.project_name}}/build.sbt.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ assemblyMergeStrategy := {
2525
fork := true
2626
javaOptions += "--add-opens=java.base/java.nio=ALL-UNNAMED"
2727

28+
// To ensure logs are written to System.out by default and not System.err
29+
javaOptions += "-Dorg.slf4j.simpleLogger.logFile=System.out"

0 commit comments

Comments
 (0)