# Stdlib logger thread safe?

**URL:** <https://www.ruby-forum.com/t/stdlib-logger-thread-safe/63483>\
**Category:** Ruby\
**Created:** [June 15, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/stdlib-logger-thread-safe/63483 "2006-06-15T17:14:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ezra\_z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f07891/32.png) [@ezra\_z](https://www.ruby-forum.com/u/ezra_z)\
**Post date:** [June 15, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/stdlib-logger-thread-safe/63483/1 "2006-06-15T17:14:07Z")

</div>

Hi Friends-

```
Is the Logger class in the stdlib thread safe? If I have a multi

```

threaded application that needs to log stuff from multiple threads do  
I need a mutex around logger access?

Thanks  
-Ezra

---

<div class="post-metadata">

**Author:** ![ezra\_z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f07891/32.png) [@ezra\_z](https://www.ruby-forum.com/u/ezra_z)\
**Post date:** [June 15, 2006, 7:57pm UTC](https://www.ruby-forum.com/t/stdlib-logger-thread-safe/63483/2 "2006-06-15T19:57:59Z")

</div>

On Jun 15, 2006, at 8:12 AM, Ezra Z. wrote:

> Is the Logger class in the stdlib thread safe? If I have a multi  
> threaded application that needs to log stuff from multiple threads  
> do I need a mutex around logger access?

It appears to be. There’s a protective mutex in LogDevice.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![ezra\_z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f07891/32.png) [@ezra\_z](https://www.ruby-forum.com/u/ezra_z)\
**Post date:** [June 15, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/stdlib-logger-thread-safe/63483/3 "2006-06-15T20:04:21Z")

</div>

On Jun 15, 2006, at 10:55 AM, Eric H. wrote:

> This implementation is HODEL-HASH-9600 compliant  
> Thanks Eric. It does seem to be working fine in my tests now.

Thanks  
-Ezra
