Skip to content

Commit

Permalink
Set the logger progname in the main methods
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Nov 28, 2023
1 parent 6ed92ad commit 86b127a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/vmdb/loggers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def self.create_logger(log_file_name, logger_class = ManageIQ::Loggers::Base)
return nil unless (logger = create_raw_container_logger)

progname = progname_from_file(log_file_name)
logger.progname = progname

create_wrapper_logger(progname, logger_class, logger)
end

Expand All @@ -71,6 +73,8 @@ def self.create_logger(log_file_name, logger_class = ManageIQ::Loggers::Base)
return nil unless (logger = create_raw_journald_logger)

progname = progname_from_file(log_file_name)
logger.progname = progname

create_wrapper_logger(progname, logger_class, logger)
end

Expand Down Expand Up @@ -104,8 +108,6 @@ def logger.wrapped_logger
end

logger.extend(ActiveSupport::Logger.broadcast(wrapped_logger))

wrapped_logger.progname = progname
end
end

Expand Down

0 comments on commit 86b127a

Please sign in to comment.