NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
176 stars 95 forks source link

Moving passive logging into the passive log instead of the listener log #995

Closed ne-bbahn closed 9 months ago

ne-bbahn commented 9 months ago

Fixes #978

Passive things will now all log to the passive log instead of the listener log.

sawolf commented 9 months ago

(Did not test, just looking at the change)

This is fine if you're valuing backward compatibility, but I don't think it's needed. The main reason we had separate ncpa_passive and ncpa_listener logs is because they were separate processes and could clobber each other when logging. Since they're in the same process now, I would expect them both to write to an ncpa.log or similar.

Also, I'm not sure how I feel about pulling in a separate dependency for different modules. If you do have active and listener "threads" such that you want them separated, shouldn't logging configuration happen at the start of each thread?

I'm not super in the weeds on this codebase, just some food for thought.

ne-bbahn commented 9 months ago

Since they're in the same process now, I would expect them both to write to an ncpa.log or similar.

NCPA 3 has a master process that spawns a listener process and a passive process. If we wanted, we could still log everything to one file using something like this though: https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

SNapier commented 9 months ago

Combining into a single log file makes sense to me but, with current log aggregation examples this would be a breaking change at install time vs.having this planned in a future version allowing users to prepare for it.

On Wed, Oct 11, 2023 at 10:43 AM bb @.***> wrote:

Since they're in the same process now, I would expect them both to write to an ncpa.log or similar.

NCPA 3 has a master process that spawns a listener process and a passive process. If we wanted, we could still log everything to one file using something like this though: https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

— Reply to this email directly, view it on GitHub https://github.com/NagiosEnterprises/ncpa/pull/995#issuecomment-1757988107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCUBVSXKEY3DQTRGD23DXDX625APANCNFSM6AAAAAA52SWPME . You are receiving this because you are subscribed to this thread.Message ID: @.***>