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

[Bug]: Logs passed to journalctl are filed every character in new log entry #206

Closed
domints opened this issue Jun 4, 2023 · 3 comments · Fixed by #216
Closed

[Bug]: Logs passed to journalctl are filed every character in new log entry #206

domints opened this issue Jun 4, 2023 · 3 comments · Fixed by #216
Assignees
Labels
bug Something isn't working
Milestone

Comments

@domints
Copy link

domints commented Jun 4, 2023

Binner version

v2.5.9

Operating System

Debian Buster 10, x64

Describe the bug and the steps to reproduce it

After I installed binner as per instruction I couldn't connect right away (no biggie here) so I looked up journalctl for logs:
journalctl -xeu Binner as I do with anything else (I'm dotnet dev as well, have moderate experience with setting up dotnet apps in linux environment).

The output that greeted me is:

Jun 04 20:31:53 vps Binner.Web[2349]: l
Jun 04 20:31:53 vps Binner.Web[2349]: i
Jun 04 20:31:53 vps Binner.Web[2349]: s
Jun 04 20:31:53 vps Binner.Web[2349]: t
Jun 04 20:31:53 vps Binner.Web[2349]: e
Jun 04 20:31:53 vps Binner.Web[2349]: n
Jun 04 20:31:53 vps Binner.Web[2349]: i
Jun 04 20:31:53 vps Binner.Web[2349]: n
Jun 04 20:31:53 vps Binner.Web[2349]: g
Jun 04 20:31:53 vps Binner.Web[2349]:  
Jun 04 20:31:53 vps Binner.Web[2349]: o
Jun 04 20:31:53 vps Binner.Web[2349]: n
Jun 04 20:31:53 vps Binner.Web[2349]: :
Jun 04 20:31:53 vps Binner.Web[2349]:  
Jun 04 20:31:53 vps Binner.Web[2349]: h
Jun 04 20:31:53 vps Binner.Web[2349]: t
Jun 04 20:31:53 vps Binner.Web[2349]: p
Jun 04 20:31:53 vps Binner.Web[2349]: s
Jun 04 20:31:53 vps Binner.Web[2349]: :
Jun 04 20:31:53 vps Binner.Web[2349]: /
Jun 04 20:31:53 vps Binner.Web[2349]: 0
Jun 04 20:31:53 vps Binner.Web[2349]: .
Jun 04 20:31:53 vps Binner.Web[2349]: 0
Jun 04 20:31:53 vps Binner.Web[2349]: .
Jun 04 20:31:53 vps Binner.Web[2349]: 0
Jun 04 20:31:53 vps Binner.Web[2349]: .
Jun 04 20:31:53 vps Binner.Web[2349]: 0
Jun 04 20:31:53 vps Binner.Web[2349]: :
Jun 04 20:31:53 vps Binner.Web[2349]: 8
Jun 04 20:31:53 vps Binner.Web[2349]: 0
Jun 04 20:31:53 vps Binner.Web[2349]: 9
Jun 04 20:31:53 vps Binner.Web[2349]: 0

Which is to say, less than perfect. I assume NLog needs to be roconfigured, although I don't have much experience with this specific logger.

Would you like to attach your appsetings.json configuration?

It's default configuration fresh from github release.

Screenshots or Videos (Optional, but they help!)

No response

Are you able to contribute a PR? (No is ok!)

Maybe, I'll investigate and start debugging

@domints domints added the bug Something isn't working label Jun 4, 2023
@replaysMike
Copy link
Owner

sorry for the delay, just getting back into this. Likely the systemd log format that journalctl is expecting isn't compatible and journalctl shows funny output. If you tail ./Binner.log you'll see that logging looks fine.

I'm looking into if NLog has a specific formatter for systemd, or if I can just create a formatter manually for it.

@replaysMike replaysMike self-assigned this Jun 26, 2023
@replaysMike replaysMike added the in-progress This ticket is currently being worked on label Jun 26, 2023
@replaysMike
Copy link
Owner

figured out the issue - by default Nlog outputs to the console in UTF-8, if I force logs to ASCII instead then it looks right. For your nlog.config, I would replace the "ColoredConsole" target entry to the following:

<target type="Console" name="console" layout="${Layout}" encoding="ascii" />

I will add this to the next release.

@replaysMike
Copy link
Owner

Added in v2.6.0

@replaysMike replaysMike removed the in-progress This ticket is currently being worked on label Jun 27, 2023
@replaysMike replaysMike added this to the v2.6.0 milestone Jun 27, 2023
replaysMike added a commit that referenced this issue Jun 27, 2023
…r in new log entry

journalctl doesn't handle UTF-8 very well, so forcing the console/log output to ASCII fixes the issue.
replaysMike added a commit that referenced this issue Jun 27, 2023
…r in new log entry

journalctl doesn't handle UTF-8 very well, so forcing the console/log output to ASCII fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants