PSA: use eventlog if winlog is causing you pain

I have a multiplatform daemon/service in which I want to use:

  • Windows Event Log when running as a service on Windows
  • env_logger when running either on Unixy platforms or on Windows as a non-service

To make a long story short, winlog made this much more complicated that it should be, imo. eventlog is a fork of winlog which is meant to remove some of winlog's warts, and it does just that.

I wish I had known this before wasting time trying to bend winlog to my will.

(Just one heads-up: The second argument to eventlog::init() doesn't seem to do what I assume it is intended to do -- instead, call the log-crate directly to set the filter).

Posting this in case it can save some time for others in the future.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.