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

Message is written in raw format in log table (with placeholders) #16

Open
zd-dalibor opened this issue Apr 11, 2020 · 2 comments
Open

Comments

@zd-dalibor
Copy link

zd-dalibor commented Apr 11, 2020

I notice that message is written in raw format in log table. For example:

Hosting environment: {envName}

and in properties column is json with values

{"envName":"Development","SourceContext":"Microsoft.Hosting.Lifetime","ApplicationName":"***"}

I need to show content of this table as html table so I need some way to show complete message with place holders replaced. Is there some easy way for doing this.

Full message can be generated with something like this in sink implementation:

// _formatProvider is instance of IFormatProvider
var message = logEvent.RenderMessage(_formatProvider);

but in this implementation StringWriter is used

var logMessageString = new StringWriter(new StringBuilder());
logEvent.RenderMessage(logMessageString);
@a7son
Copy link

a7son commented Nov 18, 2020

Do use the nugget package?
I think you should update your nugget package to 4.5.0-dev-00044
for me it work well, because the raw format will be inserted to Template column and Message placeholder will be replaced by the real value
because i have the same problem.

@zd-dalibor
Copy link
Author

@a7son Thanks for this information. I currently do not have time to test this but if this is working for you please feel free to close this issue

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

No branches or pull requests

2 participants