Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3679538
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:28:16+00:00 2026-05-19T03:28:16+00:00

In short, is the standard library Logger class in Ruby thread-safe? Only useful info

  • 0

In short, is the standard library Logger class in Ruby thread-safe? Only useful info Google turned up was someone on a forum saying it “seems” thread-safe. And I don’t feel like spending time testing a logger to try to figure out if it is or not.

For the time being I’m using log4r which is thread-safe, but it’s overkill if the standard library already does it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:28:16+00:00Added an answer on May 19, 2026 at 3:28 am

    A quick look at logger.rb reveals code such as the following:

    def write(message)
      @mutex.synchronize do
        if @shift_age and @dev.respond_to?(:stat)
          begin
            check_shift_log
          rescue
            raise Logger::ShiftingError.new("Shifting failed. #{$!}")
          end
        end
        @dev.write(message)
      end
    end
    

    So while I can’t vouch for whether it gets thread-safety correct, I can confirm that it is making a concerted effort to do it right!

    P.S. It’s often easy to answer questions like this for yourself by reading the code 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short of inserting a try/catch block in each worker thread method, is there a
Most texts on the C++ standard library mention wstring as being the equivalent of
Is there a standard or recommended getopts library for Groovy that will allow me
Developing a .net library based on an industry standard. The standard includes data structures
Is there an algorithm in the standard library that can add a value to
I am currently using the standard javax.xml.transform library to transform my XML to CSV
From the documentation for the standard library json module : json. dump ( obj,
I tried to run this code from the book 'Python Standard Library' of 'Fred
Admin.py class CourseAdmin(admin.ModelAdmin): list_display = ('course_code', 'title', 'short' ) def save_model(self, request, obj, form,
I am using the standard .Net 2.0 DataGridView with sort mode of automatic on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.