Search code examples
jrubyjvm-arguments

Where does jruby log to?


I see a lot of config options like jit.logging=true, and I want to watch out for things like when the jvm gives CodeCache is full. Compiler has been disabled messages, where does jruby log this stuff? Better yet, how can I tell it which file to log to? Is it just STDOUT and STDERR?


Solution

  • By setting JRuby properties that affects JIT Runtime Properties ( such as: jruby.jit.logging, jruby.jit.logging, jruby.jit.logging ) you get log to standard error (commonly abbreviated stderr)

    You could tell which file to log to by redirecting stderr to a specific file; for example:

    jruby -J-Djruby.jit.logging=true myscript.rb  2> myfile.log
    

    beware, however, myfile.log receives even other stderr outputs; i.e if myscript.rb executes statements such as:

    $stderr.puts "print this in stderr"
    

    you will see "print this in stderr" in myfile.log