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

Messed printing when following deleted and recreated logs #151

Closed
Lightjohn opened this issue Apr 3, 2017 · 14 comments
Closed

Messed printing when following deleted and recreated logs #151

Lightjohn opened this issue Apr 3, 2017 · 14 comments

Comments

@Lightjohn
Copy link

Hi,

I'm working and debugging an application and from time to time I delete the logs and the application will recreate them seconds later.
But the problem is that glogg is missing the new lines characters and so the printing is bad.

I'm using the latest version from the git.
I know it's not an usual way to work and just wanted to let you know that.

@bristolweb
Copy link

I have a similar problem. I upgraded recently to 1.1.3 from 0.9 on linux Mint 17.3 (Rosa). Reason for upgrading: I needed more than the 5 logs easily available from 0.9. I really like the new 1.1.3 tabs for selecting each log! :)

Version 1.1.3 seems fine except that every time one of the logs is rotated (ie most mornings depending on the log) I have to drop glogg and reload it. Not a major problem since unlike syslog viewer the log names and filter colours are retained and all I have to do is hit Follow for each log. Still annoying, though. Reload has no effect on this.

Primary logs used in this situation are mail (postfix), dovecot, spamd, clamav and ubound. Various apache logs are also viewed depending on current needs. Mail log is usually ok but dovecot always displays with no regard for newlines.

@nickbnf
Copy link
Owner

nickbnf commented May 19, 2017

Could you check if the problem is still happening with 1.1.4? A bug was fixed that might be the root cause for what you are seeing as well.

@bristolweb
Copy link

Not sure how to download/install 1.1.4 - apt-get install just says "latest version installed". Could you give some idea, please? Linux Mint 17.3.

@Lightjohn
Copy link
Author

Lightjohn commented May 19, 2017 via email

@nickbnf
Copy link
Owner

nickbnf commented May 19, 2017

OK, so we have a real problem here, the fact reloading is not doing anything is especially bizarre. Do you have a scenario where you can reproduce the problem 100%? I'll give it a try.

@Lightjohn
Copy link
Author

Lightjohn commented Jun 15, 2018

Hi sorry for the late comeback, I'm still getting the issue so just went back and saw your message.
At least with time I know exactly what cause the issue in my case.
My application is rotating the log every hour and every time it happen while I'm watching, the output will be all messed up.
So I think just:

move current log and and wait for the application to recreate it is enough in my case.

It's still happening for me and I compile directly from git from time to time (just done that before that message) and the only solution to solve that is to close and reopen glogg.
Do you want a script that could reproduce it?

@gin-ahirsch
Copy link
Contributor

Can you try PR #222? It changes things when re-opening files some.

@Lightjohn
Copy link
Author

I just tried and it's working :)
It seems I will just have to wait for your changes to be merged.

Thank you

@nickbnf nickbnf mentioned this issue Jun 22, 2018
@nickbnf
Copy link
Owner

nickbnf commented Jun 22, 2018

When your app recreate the log, does it create an empty file and then append to it, or is it creating an already full file (like a log rotation tool would do)?

@Lightjohn
Copy link
Author

In my case it's just log4j auto rotate option, so the file would be very briefly an empty file, then a lot of logs will be appended.

@crazycliffy
Copy link

crazycliffy commented Jun 12, 2020

Anyone experiencing any issue with this still? I compiled from the latest version 1.1.4 for linux (redhat/centos) target. When the file gets rolled over (e.g. "mv file.log file.log.1; cp file.log.1 file.log"), I see garbled, messed up text displayed in glogg. Using the Reload (Ctrl-R) feature does not fix the issue. As a workaround, I have to close the file, and just reopen it.

@Lightjohn
Copy link
Author

I still have this issue.
Same I just close and re open the app all the time.
And because I use glogg as debug tool I close reopen it quite a lot

@variar
Copy link
Contributor

variar commented Jul 6, 2020

@Lightjohn is this issue present in glogg built from latest master? I've chery-picked fix into my fork, but if the problem is still present in glogg master, then I'll have to find some other fix.

@Lightjohn
Copy link
Author

@variar Latest build from master seems OK I played with it a little bit by moving logs with a script.

So the fix is not in buntu repo but that's another story! Fix is here and working. Thank you

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

6 participants