Glassfish gem log format

Hi

Is it possible to change the log format in the glassfish gem? I find
the multi-line format from java.util.logging.SimpleFormatter really hard
to read, especially combined with the multi line output from Rails.

Looking at the source of glassfish gem it looks like SimpleFormatter is
hard coded. I have tried to get the gem to use a different
logger.properties without success. Has anyone had any success this way?

Looking at the latest code in the svn repo I see that there is a new
custom GlassFishLogFormatter with what looks like a much nicer handling
of the rails log. But it also looks like this formatter will only be
used for console logging. Maybe there could be a property in
glassfish.yml for selecting the formatter for the log file?

Are there any nightly builds of glassfish gem available so that I can
try the new formatter?

/ Jonas

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

There is no easy way except how you would override any Java Logger. for
the
upcoming gem release its re-factored. The console logging is pretty
much
left to how a given framework (such as Rails or Rack::CommonLogger or
Sinatra etc.) would like to log. The logs in the file is the one coming
from
the framework as well as server and so has the JDK logging mixed with it
but
I think its an improvement over existing behavior.

Please check it out,
http://hudson.glassfish.org/job/glassfish-gem-build/and let us know.

-vivek.

On 8 dec 2009, at 06.04, Vivek P. wrote:

There is no easy way except how you would override any Java Logger. for the upcoming gem release its re-factored. The console logging is pretty much left to how a given framework (such as Rails or Rack::CommonLogger or Sinatra etc.) would like to log. The logs in the file is the one coming from the framework as well as server and so has the JDK logging mixed with it but I think its an improvement over existing behavior.

Please check it out, http://hudson.glassfish.org/job/glassfish-gem-build/ and let us know.

Yes I figured it out and did something like this:

class RailsLogFormatter < java.util.logging.Formatter
def format(record)
msg = record.getMessage()
if(!msg.end_with?(“\n”))
msg << “\n”
end
return msg
end
end

logger = java.util.logging.Logger.getLogger(“”)

logger.getHandlers().each do |h|
h.setFormatter(RailsLogFormatter.new)
end

That gave me a log looking just like the regular rails log. It works
well for development at least.

/ Jonas

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I haven’t tried 0.9.6.dev yet but from what I remember from the source
it does roughly the same thing but only for the console logger?

/ Jonas

On 9 dec 2009, at 18.28, Vivek P. wrote:

Please check it out, http://hudson.glassfish.org/job/glassfish-gem-build/ and let us know.
end
/ Jonas


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hmm! I thought this is how 0.9.6.dev generates. Are you seening any
different behavior with 0.9.6.dev?

-vivek.

On Wed, Dec 9, 2009 at 9:48 AM, Jonas T. [email protected] wrote:

I haven’t tried 0.9.6.dev yet but from what I remember from the source it
does roughly the same thing but only for the console logger?

It was fixed sometime back in ver 0.9.6.dev. See http://bit.ly/6AABjE.
Extra
newline applies in this case only to the Logger emitting messages from
Rails
or Sinatra or anything running on glassfish gem.

-vivek.