Fwd: Logging issue w/ JRuby 1.1.2 on Glassfish

Bringing this back to the list, as I haven’t gotten any further by
digging into Rack and am not sure where my solution lies.

-Joel

----- Forwarded Message -----
From: “Joel E. Wilson” [email protected]
To: “Jan Luehe” [email protected]
Cc: “Arun G.” [email protected]
Sent: Monday, July 21, 2008 3:44:44 PM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] Logging issue w/ JRuby 1.1.2 on Glassfish

The console page for setting up the virtual server has a section with a
server log and a separate section for access log, which I guess I can
turn on from the main HTTP Listener configuration screen. I did a bit
more playing around. I wanted to try a none JRuby/Rails application to
make sure that wasn’t the problem. This time I took the logging sample
that can be downloaded from the Glassfish site and first installed it in
my default server at 8080 to confirm that it produces the expected log
output. It does. Then I installed it in my second virtual server on
3333 and confirmed that it doesn’t.

When I had made a mistake in the environment.rb file of my test
application in a way that created a syntax error, the error /did/ make
it into the testapp logfile (the name I gave the 2nd server’s log), so
it would appear that STDOUT or STDERR output may make it in there, but
standard log output does not. Rails 2.x uses
ActiveSupport::BufferedLogger by default. I put <%=
h(RAILS_DEFAULT_LOGGER.inspect) %> into my test page and discovered that
the log device is set to JRuby::Rack::ServletLog. Looking into the Rack
code indicates that it’s hard coding env[‘rails.error’] to that. I’m
not in front of my workstation where I was researching this, but I think
$servletcontext.log was involved in that definition, too.
Unfortunately, Rack hardcodes it and doesn’t appear to give a mechanism
for working around it, so that I can redefine the logger to go to some
file without hacking into the Rack code.

-Joel

----- Original Message -----
From: “Jan Luehe” [email protected]
To: “Joel E. Wilson” [email protected]
Cc: “Arun G.” [email protected]
Sent: Friday, July 18, 2008 10:38:50 AM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] Logging issue w/ JRuby 1.1.2 on Glassfish

Joel,

Joel E. Wilson wrote:

Thank you. I’ve got the default setting, which is that access logs aren’t turned on. I’m referring to the server logs.

I’m not aware that we support separate server log files per virtual
server.
Separate log files per virtual server are only supported for access
logging.

Jan

Hi Joel,

-Joel

All of the apps that I’m working to transition from pack-of-mongrels to
statement to generate an exception trace and still nothing is written,
Have you done anything to explicitly override the Rails logger?
To unsubscribe from this list, please visit:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I could really use some help from one of the Rack developers with this
issue. I apologize for the length, but the message on July 21st
probably sums up enough for you to determine what I’m trying to do.
Basically, Glassfish virtual servers don’t properly create their own
separate logs and since I want to host multiple apps inside of a single
Glassfish installation and don’t want their log output all going to the
same place, that is a problem. I can’t seem to override the logging
settings within the Rails configuration files because of the way Rack is
written.

Any help with this problem would be appreciated.

Thank you,

Joel

----- Original Message -----
From: “Joel E. Wilson” [email protected]
To: “JRuby U.” [email protected]
Sent: Thursday, July 24, 2008 9:49:37 PM GMT -06:00 US/Canada Central
Subject: Fwd: [jruby-user] Logging issue w/ JRuby 1.1.2 on Glassfish

Bringing this back to the list, as I haven’t gotten any further by
digging into Rack and am not sure where my solution lies.

-Joel

----- Forwarded Message -----
From: “Joel E. Wilson” [email protected]
To: “Jan Luehe” [email protected]
Cc: “Arun G.” [email protected]
Sent: Monday, July 21, 2008 3:44:44 PM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] Logging issue w/ JRuby 1.1.2 on Glassfish

The console page for setting up the virtual server has a section with a
server log and a separate section for access log, which I guess I can
turn on from the main HTTP Listener configuration screen. I did a bit
more playing around. I wanted to try a none JRuby/Rails application to
make sure that wasn’t the problem. This time I took the logging sample
that can be downloaded from the Glassfish site and first installed it in
my default server at 8080 to confirm that it produces the expected log
output. It does. Then I installed it in my second virtual server on
3333 and confirmed that it doesn’t.

When I had made a mistake in the environment.rb file of my test
application in a way that created a syntax error, the error /did/ make
it into the testapp logfile (the name I gave the 2nd server’s log), so
it would appear that STDOUT or STDERR output may make it in there, but
standard log output does not. Rails 2.x uses
ActiveSupport::BufferedLogger by default. I put <%=
h(RAILS_DEFAULT_LOGGER.inspect) %> into my test page and discovered that
the log device is set to JRuby::Rack::ServletLog. Looking into the Rack
code indicates that it’s hard coding env[‘rails.error’] to that. I’m
not in front of my workstation where I was researching this, but I think
$servletcontext.log was involved in that definition, too.
Unfortunately, Rack hardcodes it and doesn’t appear to give a mechanism
for working around it, so that I can redefine the logger to go to some
file without hacking into the Rack code.

-Joel

----- Original Message -----
From: “Jan Luehe” [email protected]
To: “Joel E. Wilson” [email protected]
Cc: “Arun G.” [email protected]
Sent: Friday, July 18, 2008 10:38:50 AM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] Logging issue w/ JRuby 1.1.2 on Glassfish

Joel,

Joel E. Wilson wrote:

Thank you. I’ve got the default setting, which is that access logs aren’t turned on. I’m referring to the server logs.

I’m not aware that we support separate server log files per virtual
server.
Separate log files per virtual server are only supported for access
logging.

Jan

Hi Joel,

-Joel

All of the apps that I’m working to transition from pack-of-mongrels to
statement to generate an exception trace and still nothing is written,
Have you done anything to explicitly override the Rails logger?
To unsubscribe from this list, please visit:


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

If you just want to use Rails’ own logging and have application log
files written in WEB-INF/log where the application is deployed, you
could try this bit of code. Put it in config/preinitializer.rb inside
your Rails app.

class JRuby::Rack::RailsServletHelper
def setup_logging; end
end

This should cause JRuby-Rack to skip the override that causes log
output to go to the appserver log, thus retaining the original Rails
loggers.

/Nick

On Wed, Jul 30, 2008 at 8:08 PM, Joel E. Wilson [email protected] wrote:

To: “JRuby U.” [email protected]
Cc: “Arun G.” [email protected]
From: “Jan Luehe” [email protected]

From: “Arun G.” [email protected]
– cut here –
Thanks,

-Arun

To: [email protected]

each application.

possible to send each server’s output to a separate log file. You


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

Whoops! It’s setup_logger, not setup_logging. It’s here:

http://github.com/nicksieger/jruby-rack/tree/master/src/main/ruby/jruby/rack/rails.rb#L80

/Nick

On Thu, Jul 31, 2008 at 9:44 PM, Joel E. Wilson [email protected] wrote:

If you just want to use Rails’ own logging and have application log
loggers.

Joel

Hi Joel,

-Joel

All of the apps that I’m working to transition from pack-of-mongrels to
statement to generate an exception trace and still nothing is written,
Have you done anything to explicitly override the Rails logger?
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thank you for the quick reply. I did a search for setup_logging in the
Rack code and couldn’t find it. I wanted to at least see what it was
doing before I skipped it. I can’t find it, though. Did they remove it
from trunk? What version is it in?

-Joel

----- Original Message -----
From: “Nick S.” [email protected]
To: [email protected]
Sent: Wednesday, July 30, 2008 10:38:35 PM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] Rack logging issue

If you just want to use Rails’ own logging and have application log
files written in WEB-INF/log where the application is deployed, you
could try this bit of code. Put it in config/preinitializer.rb inside
your Rails app.

class JRuby::Rack::RailsServletHelper
def setup_logging; end
end

This should cause JRuby-Rack to skip the override that causes log
output to go to the appserver log, thus retaining the original Rails
loggers.

/Nick

On Wed, Jul 30, 2008 at 8:08 PM, Joel E. Wilson [email protected] wrote:

To: “JRuby U.” [email protected]
Cc: “Arun G.” [email protected]
From: “Jan Luehe” [email protected]

From: “Arun G.” [email protected]
– cut here –
Thanks,

-Arun

To: [email protected]

each application.

possible to send each server’s output to a separate log file. You


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

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Sorry about the slow response. This worked great! Do you think this
might be configurable at some point?

-Joel

----- Original Message -----
From: “Nick S.” [email protected]
To: [email protected]
Sent: Thursday, July 31, 2008 10:48:29 PM GMT -06:00 US/Canada Central
Subject: Re: [jruby-user] Rack logging issue

Whoops! It’s setup_logger, not setup_logging. It’s here:

http://github.com/nicksieger/jruby-rack/tree/master/src/main/ruby/jruby/rack/rails.rb#L80

/Nick

On Thu, Jul 31, 2008 at 9:44 PM, Joel E. Wilson [email protected] wrote:

If you just want to use Rails’ own logging and have application log
loggers.

Joel

Hi Joel,

-Joel

All of the apps that I’m working to transition from pack-of-mongrels to
statement to generate an exception trace and still nothing is written,
Have you done anything to explicitly override the Rails logger?
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

http://xircles.codehaus.org/manage_email


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

It certainly could be. I’ll have to think about how to make the option
easily accessible. For example, the session store defaults to
:java_servlet_store, but if you explicitly set config.session_store in
config/environment.rb it honors your preference. So I’d expect to come
up with something along those lines.

/Nick

On Sun, Aug 3, 2008 at 10:37 PM, Joel E. Wilson [email protected] wrote:

Whoops! It’s setup_logger, not setup_logging. It’s here:

----- Original Message -----
class JRuby::Rack::RailsServletHelper

I could really use some help from one of the Rack developers with this issue. I apologize for the length, but the message on July 21st probably sums up enough for you to determine what I’m trying to do. Basically, Glassfish virtual servers don’t properly create their own separate logs and since I want to host multiple apps inside of a single Glassfish installation and don’t want their log output all going to the same place, that is a problem. I can’t seem to override the logging settings within the Rails configuration files because of the way Rack is written.
Sent: Thursday, July 24, 2008 9:49:37 PM GMT -06:00 US/Canada Central
Sent: Monday, July 21, 2008 3:44:44 PM GMT -06:00 US/Canada Central
To: “Joel E. Wilson” [email protected]

To: “Joel E. Wilson” [email protected]n.invalid
Notice that by default, the access log file for every virtual server is
-Arun

----- Original Message -----

Sent: Tuesday, July 15, 2008 11:05:15 AM GMT -06:00 US/Canada Central

I’m using Glassfish v2 UR2 b04 on Mac OS X 10.5 and packaging the
might try asking on one of the Glassfish lists for help.

To unsubscribe from this list, please visit:



To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs