Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing specifying the log facility #9

Closed
wants to merge 2 commits into from

Conversation

dra27
Copy link
Contributor

@dra27 dra27 commented Aug 14, 2018

As discussed in #7, this adds ?facility to all the reporters and also Logs_syslog.facility which can be used to specify the facility for a specific log message.

My test program includes:

let facility f = Logs.Tag.(empty |> add Logs_syslog.facility f);;

Logs.warn ~src (fun m -> m ... ~tags:facility Syslog_message.Local2)

I couldn't decide if the function was useful enough to bother adding to the API (you'd obviously need something different if you actually have multiple tags).

dra27 added 2 commits August 14, 2018 21:06
All reporters now have a ?facility argument which is passed through to
logs_syslog.message.
Logs_syslog.facility is a Syslog_message.facility Logs.Tag.def which is
recognised by all the reporters as overriding the ?facility argument
provided to the reporter (or the default in Logs_syslog.message).

Fixes hannesm#7
@dra27
Copy link
Contributor Author

dra27 commented Aug 14, 2018

(I originally wrote this atop #5, so I have commits ready to replace the ones which will conflict there)

@hannesm
Copy link
Owner

hannesm commented Aug 15, 2018

thanks, I manually cherry-picked these (and added some commits)..

@hannesm hannesm closed this Aug 15, 2018
@dra27 dra27 deleted the facility-tag branch August 15, 2018 09:59
hannesm added a commit to hannesm/opam-repository that referenced this pull request Oct 27, 2018
CHANGES:

- support for syslog-message.1.0.0
  it split the `message` field of Syslog_message.t into `tag` and `content`
  use the name of Logs.src as tag when sending messages
- move build system to dune (hannesm/logs-syslog#10 by @dra27)
- provide Logs_syslog.facility Logs.Tag.def to specify facility in log
  message, add ?facility as default facility to all reporters (reported in hannesm/logs-syslog#7,
  fixed in hannesm/logs-syslog#9 by @dra27)
- append ':' to source (reported in hannesm/logs-syslog#6, fixed in hannesm/logs-syslog#8 by @dra27)
- add missing dependency on unix for logs-syslog.unix (hannesm/logs-syslog#4 by @dra27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants