Warning: Declaration of LJXP_Walker_Category_Checklist::start_lvl(&$output, $depth, $args) should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Declaration of LJXP_Walker_Category_Checklist::end_lvl(&$output, $depth, $args) should be compatible with Walker::end_lvl(&$output, $depth = 0, $args = Array) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Declaration of LJXP_Walker_Category_Checklist::start_el(&$output, $category, $depth, $args) should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Declaration of LJXP_Walker_Category_Checklist::end_el(&$output, $category, $depth, $args) should be compatible with Walker::end_el(&$output, $object, $depth = 0, $args = Array) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php on line 796

Warning: Cannot modify header information - headers already sent by (output started at /home/victorsergienko/victorsergienko.com/wp-content/plugins/lj-xp/lj-xp-options.php:796) in /home/victorsergienko/victorsergienko.com/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 60
code name / Getting Glassfish stdout logging under control
Skip to content

Getting Glassfish stdout logging under control


By default, Glassfish does an ugly thing: takes an application’s stdout/stderr and wraps it into its own log with INFO level for stdout and WARN level for stderr.
Other logging facility normally log to stdout.
In the end, a log entry looks pretty stupidly (and it’s damn multiline!):

[#|2012-11-21T11:25:07.225+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=100;_ThreadName=Thread-2;|11:25:07.225 [http-thread-pool-8080(2)] DEBUG c.mycompany.packages.SomeClass - Finally, some useful text!
|#]

One can replace a Glassfish logging server-wide.
There’s a logging.properties file in the root of Glassfish domain, it has a “handlers” property that one can swap for Logback’s handler.
Of course, this requires adding Logback JUL bridge to Glassfish classpath.

Post a Comment

Your email is never published nor shared.