Skip to content

Implement windows event logging #413

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

Merged
merged 1 commit into from
Dec 30, 2016
Merged

Implement windows event logging #413

merged 1 commit into from
Dec 30, 2016

Conversation

ColinSullivan1
Copy link
Member

Currently, the windows sys logger is a stub for standard logging. This PR implements windows event logging as the “syslog" for the NATS server on windows.

Using the -s or -r parameters on windows will enable logging to the windows event log.

  • The event source is NATS-Server, and data is written to the Application log.
  • Writing to the event log requires an elevated privilege. If the user does not have required privileges, the server panics.
  • Log messages are written to the Application event log in the following format: pid[<pid>]:[<type>]: Message
  • Notice, Trace, and Debug messages are written as info messages and Errorf or Fatalf log messages are logged as event log errors.
  • Remote logging is supported.
  • Includes tests and vendoring

Here is what a NATS server log entry looks like in the windows event viewer:
screen shot 2016-12-29 at 3 32 28 pm

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 89.217% when pulling 1df5af0 on windows-event-log into bc5f864 on master.

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.

3 participants