# Using the logger from Libs directory

**URL:** <https://www.ruby-forum.com/t/using-the-logger-from-libs-directory/160233>\
**Category:** Rails\
**Created:** [February 13, 2009, 9:50am UTC](https://www.ruby-forum.com/t/using-the-logger-from-libs-directory/160233 "2009-02-13T09:50:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergio.sprite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@sergio.sprite](https://www.ruby-forum.com/u/sergio.sprite)\
**Post date:** [February 13, 2009, 9:50am UTC](https://www.ruby-forum.com/t/using-the-logger-from-libs-directory/160233/1 "2009-02-13T09:50:25Z")

</div>

Hello everybody, I need to log some messages from some class on Libs  
directory, do you know how can I access the logger.info from this  
directory ? is there a way to do this ? I would appreciate your help,  
thanks in advice

---

<div class="post-metadata">

**Author:** ![sergio.sprite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@sergio.sprite](https://www.ruby-forum.com/u/sergio.sprite)\
**Post date:** [February 13, 2009, 1:40pm UTC](https://www.ruby-forum.com/t/using-the-logger-from-libs-directory/160233/2 "2009-02-13T13:40:56Z")

</div>

On 13 Feb., 00:39, “sergio.sprite” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello everybody, I need to log some messages from some class on Libs  
> directory, do you know how can I access the logger.info from this  
> directory ? is there a way to do this ? I would appreciate your help,  
> thanks in advice

if you use a rake with option ‘environment’, just use that:

RAILS\_DEFAULT\_LOGGER.info(‘xxxx’)

😉

---

<div class="post-metadata">

**Author:** ![sergio.sprite](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@sergio.sprite](https://www.ruby-forum.com/u/sergio.sprite)\
**Post date:** [February 13, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/using-the-logger-from-libs-directory/160233/3 "2009-02-13T14:36:19Z")

</div>

On 13 Feb 2009, at 12:40, Oldtimer wrote:

> RAILS\_DEFAULT\_LOGGER.info(‘xxxx’)

Or Rails.logger (which boils down to the same thing)
