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

Add event data parameters to event log xml #41

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

mcollera
Copy link

No description provided.

@flennic
Copy link

flennic commented Oct 29, 2021

Is there a way to merge this in and to release a new version? Would really like to see all properties as well!

@@ -31,7 +31,7 @@ namespace Serilog.Sinks.EventLog
public class EventLogSink : ILogEventSink
{
const string ApplicationLogName = "Application";
const int MaximumPayloadLengthChars = 31839;
const int MaximumPayloadLengthChars = 31639;
Copy link
Member

Choose a reason for hiding this comment

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

The EventLog.WriteEntry documentation says

The message string is longer than 31,839 bytes (32,766 bytes on Windows operating systems before Windows Vista).

Is this incorrect?

Copy link
Member

Choose a reason for hiding this comment

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

After running the UsingSuperLongLogMessageWorks test repeatedly while tweaking the MaximumPayloadLengthChars value I figured the actual max length is 31718 on Windows 10. Can you confirm this observation?

Copy link

Choose a reason for hiding this comment

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

@0xced This PR would be a very nice improvement so I jumped in and ran the UsingSuperLongLogMessageWorks test too, Win 11 22H2.

The projects dev branch the actual max length is 31701 for me. On mcolleras PR it only worked up to 31698.
Not sure if this is helpful or just making it worse. :)

Copy link
Member

Choose a reason for hiding this comment

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

🤦‍♂️ Nobody seems to know what the actual limit is, see also dotnet/dotnet-api-docs#9999 (comment)

Not sure what's the best course of action.

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.

4 participants