Project

General

Profile

Actions

Bug #13727

closed

Not able to set program_name for new Syslog::Logger

Added by printercu (Max Melentiev) over 7 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:81949]

Description

Hi!

Every instance of syslog logger uses same program_name as first initialized one, because they all share single instance of Syslog (https://github.com/ruby/ruby/blob/trunk/ext/syslog/lib/syslog/logger.rb#L195)

logger1 = Syslog::Logger.new('tag-1', Syslog::LOG_LOCAL1)
logger2 = Syslog::Logger.new('tag-2', Syslog::LOG_LOCAL1)
logger.info { 'test' } # logged with tag-1
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0