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

.Net Core and Serilog. Error from client. Strange formatting of Error #166

Open
Almenit opened this issue May 7, 2018 · 5 comments
Open

Comments

@Almenit
Copy link
Contributor

Almenit commented May 7, 2018

Fatal exception from client gets strange formatting using Serielog and .Net Core.

Request payload from client:
{"lg":[{"l":6000,"m":"{\"stack\":\"Error: Server internal error\\n at XMLHttpRequest.req.onreadystatechange (webpack-internal:///./C/Content/Scripts/data/AjaxCaller.ts:58:24)\",\"message\":\"Server internal error\",\"name\":\"Error\",\"logData\":\"Server internal error\"}","n":"Reflect Client","t":1525702860451,"u":1}]}

Log in console:
image

@Almenit Almenit changed the title .Net Core and Serilog. Error from client .Net Core and Serilog. Error from client. Strange formatting of Error May 7, 2018
@mperdeck
Copy link
Owner

mperdeck commented Jun 9, 2018

Sorry for the late reply. I vaguely remember fixing this a while ago in a previous version of JSNLog.

Which version of JSNLog do you use? If it is not the latest, please upgrade to the latest version.
Do you use .Net Core or .Net Framework (the version of .Net before Core)?
If the problem persists, please publish a small test project on Github that allows me to reproduce the problem.

@ckosti
Copy link

ckosti commented Jun 12, 2019

I have the same issue. I'm using .NET Core 2.1 with Serilog.AspNetCore version 2.1.1 and JSNLog version 2.29.0 on the server and the client.

I put an example project together at https://github.com/ckosti/jsnlog-serilog-test

@ckarcz
Copy link

ckarcz commented Apr 14, 2021

bump. still getting this as of 2021!!! using .net core/standard.

@ckarcz
Copy link

ckarcz commented Apr 15, 2021

by the way, i've narrowed this down to only happening with

"ServerSideMessageFormat": "%message"

but when I do

"ServerSideMessageFormat": "[Browser] %message"

the object is log as expected:

[22:03:43.486 FTL]: [Browser] {"e":{"headers":{"normalizedNames":{},"lazyUpdate":null},"status":401,"statusText":"OK","url":"https://e550c3e88f89.ngrok.io/api/auth/session/1cd5a4f6-253a-4737-b1da-745e34eabb25/app-token/refresh","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://e550c3e88f89.ngrok.io/api/auth/session/1cd5a4f6-253a-4737-b1da-745e34eabb25/app-token/refresh: 401 OK","error":null},"message":"Http failure response for https://e550c3e88f89.ngrok.io/api/auth/session/1cd5a4f6-253a-4737-b1da-745e34eabb25/app-token/refresh: 401 OK","name":"HttpErrorResponse","logData":"An unhandled error has occured."}

hope this helps in fixing this! thanks.

@dgoldm
Copy link

dgoldm commented Jul 4, 2023

but when I do

"ServerSideMessageFormat": "[Browser] %message"

the object is log as expected:

Thanks for the workaround. I do hope that the issue gets fixed ASAP

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

5 participants