Skip to content

Qmsg: in case of syslog logging use adapted log priority instead of always LOG_ERR#1134

Merged
arogge merged 3 commits intomasterfrom
dev/pstorz/master/fix-tls-syslog-err-story-5051
Apr 5, 2022
Merged

Qmsg: in case of syslog logging use adapted log priority instead of always LOG_ERR#1134
arogge merged 3 commits intomasterfrom
dev/pstorz/master/fix-tls-syslog-err-story-5051

Conversation

@pstorz
Copy link
Member

@pstorz pstorz commented Mar 22, 2022

In the case that normal logging is not possible, Qmsg() logs to syslog.
Instead of logging with severity LOG_ERR in this case without regarding
the message type, we now translate the bareos message type to a syslog
severity.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing

@pstorz pstorz requested a review from bruno-at-bareos March 22, 2022 12:01
In the case that normal logging is not possible, Qmsg() logs to syslog.
Instead of logging with priority LOG_ERR in this case without regarding
the message type, we now  translate the bareos message type to a syslog
priority.
@pstorz pstorz force-pushed the dev/pstorz/master/fix-tls-syslog-err-story-5051 branch from b9d0336 to a09f217 Compare March 22, 2022 12:35
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's just the CHANGELOG entry missing, otherwise works like a charm.

@pstorz pstorz changed the title Qmsg: in case of syslog logging use adapted log severity instead of LOG_ERR always Qmsg: in case of syslog logging use adapted log priority instead of always LOG_ERR Mar 22, 2022
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, approved ready for merge after last build

@bruno-at-bareos
Copy link
Contributor

@pstorz what about making also a backport to 21 as the change finally are somewhat trivial ?

Move the existing conversion for the syslog backend into the new
MessageTypeToLogPriority() so we have only one common location to do the
conversion.
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements, making it even clearer.

@arogge arogge merged commit 552914f into master Apr 5, 2022
@arogge arogge deleted the dev/pstorz/master/fix-tls-syslog-err-story-5051 branch April 5, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants