Ruby Forum JRuby > Merb on Websphere using RackServlet writes production.log to "/" (root of machine's filesystem)

Posted by Wes Gamble (weyus)
on 18.08.2008 19:23
(Received via mailing list)
JRuby 1.1.3
Rack 0.3.0
Merb 0.9.4
Warbler 0.9.10

I have an app. that appears to be "successfully" deployed to Websphere
through warbler, but my production.log file is being written to the
machine's root directory "/", instead of to the log directory under
WEB-INF.  I think I saw something while I was Googling about this a
couple of days ago, but I can't remember - has anyone experienced it?

Thanks,
Wes

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Nick Sieger (Guest)
on 18.08.2008 21:50
(Received via mailing list)
On Mon, Aug 18, 2008 at 12:23 PM, Wes Gamble <weyus@att.net> wrote:
> JRuby 1.1.3
> Rack 0.3.0
> Merb 0.9.4
> Warbler 0.9.10
>
> I have an app. that appears to be "successfully" deployed to Websphere
> through warbler, but my production.log file is being written to the
> machine's root directory "/", instead of to the log directory under WEB-INF.
>  I think I saw something while I was Googling about this a couple of days
> ago, but I can't remember - has anyone experienced it?

Yikes! This is probably an artifact of the call to
ServletContext.getRealPath not returning anything useful (e.g., null).
I have it on my list to work up a different mechanism for determining
the location of RAILS_ROOT.

/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Wes Gamble (weyus)
on 18.08.2008 23:15
(Received via mailing list)
Nick Sieger wrote:
>>  I think I saw something while I was Googling about this a couple of days
>> ago, but I can't remember - has anyone experienced it?
>>     
>
> Yikes! This is probably an artifact of the call to
> ServletContext.getRealPath not returning anything useful (e.g., null).
> I have it on my list to work up a different mechanism for determining
> the location of RAILS_ROOT.
>   
Here's my MERB_ROOT/config/environments/production.rb:

Merb.logger.info("Loaded PRODUCTION Environment...")
Merb::Config.use { |c|
  c[:exception_details] = false
  c[:reload_classes] = false
  c[:log_level] = :error
  c[:log_file] = Merb.log_path + "/production.log"
}

I could _swear_ that when I first started deploying into the container
that the log file would be in the correct place, but now it's not.  I
suspect that perhaps Merb.log_path evaluates to nil, although I haven't
checked yet.

Wes

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Wes Gamble (weyus)
on 19.08.2008 18:08
(Received via mailing list)
Wes Gamble wrote:
>>> through warbler, but my production.log file is being written to the
>> the location of RAILS_ROOT.
>>   
> Here's my MERB_ROOT/config/environments/production.rb:
>
> Merb.logger.info("Loaded PRODUCTION Environment...")
> Merb::Config.use { |c|
>  c[:exception_details] = false
>  c[:reload_classes] = false
>  c[:log_level] = :error
>  c[:log_file] = Merb.log_path + "/production.log"
> }
If I modify my production.rb slightly, like so - the logging occurs in
the log directory, as you would expect:

Merb.logger.info("Loaded PRODUCTION Environment...")
Merb::Config.use { |c|
  c[:exception_details] = false
  c[:reload_classes] = false
  c[:log_level] = :debug
  #c[:log_file] = Merb.log_path + "/production.log"
  c[:log_file] = "log/production.log"
}

Wes

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Charles Oliver Nutter (Guest)
on 30.08.2008 23:30
(Received via mailing list)
Wes Gamble wrote:
> the log directory, as you would expect:
Can you file a bug for this and/or add something to the wiki? I suspect
this could bite others using WebSphere very easily.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email