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

Eventlog audit events #559

Merged
11 commits merged into from
Feb 13, 2015
Merged

Eventlog audit events #559

11 commits merged into from
Feb 13, 2015

Conversation

304NotModified
Copy link
Member

added optional property EntryType (layoutable), closes #289

With this property we can log to all various levels: Error, FailureAudit, Information, SuccessAudit & Warning. MSDN EventLogEntryType

If not set, then uses the backwards compatible behavior:

  • LogLevel.Trace => EventLogEntryType.Information
  • LogLevel.Debug => EventLogEntryType.Information
  • LogLevel.Info => EventLogEntryType.Information
  • LogLevel.Warn => EventLogEntryType.Warning
  • LogLevel.Error => EventLogEntryType.Error
  • LogLevel.Fatal => EventLogEntryType.Error

Doc:

<targets>
  <target xsi:type="EventLog"
          name="String"
          layout="Layout"
          machineName="String"
          source="String"
          category="Layout"
          eventId="Layout"
          entryType="Layout" <!-- new -->
          log="String" />
</targets>

Including unit tests, also unit tests for backwards compatible behavior

@304NotModified
Copy link
Member Author

I will fix the build error. Maybe I should edit the .net 3.5 project first, as I used .Net 4 stuff (Enum.TryParse)

note for myself: https://stackoverflow.com/questions/15017151/implementation-of-enum-tryparse-in-net-3-5

@ghost
Copy link

ghost commented Feb 8, 2015

@304NotModified So this makes it possible to use a fixed entry type? Would that make sense? I mean effectively ignoring the log level?

@304NotModified
Copy link
Member Author

Well it's layoutable, so we can use conditions.

@ghost
Copy link

ghost commented Feb 9, 2015 via email

ghost pushed a commit that referenced this pull request Feb 13, 2015
@ghost ghost merged commit 4cca495 into NLog:master Feb 13, 2015
@ghost ghost added this to the 4.0 milestone Feb 13, 2015
@304NotModified 304NotModified deleted the eventlog-audit-events branch March 28, 2015 12:25
@304NotModified 304NotModified added the documentation done all docs done (wiki, api docs, lists on nlog-project.org, xmldocs) label Jan 14, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation done all docs done (wiki, api docs, lists on nlog-project.org, xmldocs) event-log-target feature needs documentation on wiki
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants