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

Server log files do not contain timestamps #16729

Open
amphyploid opened this issue Jun 26, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@amphyploid
Copy link

commented Jun 26, 2019

I am trying to debug my dedicated servers and am in need of timestamps in the server log files in order to compare the activity from the logs with the activity shown in my server resource utilization analytics. As it stands, there is no way for me to compare events from these two data sources.

@amphyploid amphyploid changed the title Logs do not contain timestamps Log files do not contain timestamps Jun 26, 2019

@amphyploid

This comment has been minimized.

Copy link
Author

commented Jun 26, 2019

I normally run server processes detached from the console, but I am aware that timestamps are written to the console and that I could redirect the console output to a file. This may be helpful, but I've noticed that what's written to the console is incomplete. There seem to be events that are written to the log files that are not written to the console. For example, the error I experienced in #16728 appears in dedicated-server.log, but not in the console. Either including timestamps in the log files or including timestamped errors in the console would suffice, but there might be technical limitations with the latter.

I'm not too familiar with this codebase, but maybe changing OpenRA.Game/Support/Log.cs#L84 to:

writer.WriteLine("[{0}] {1}", DateTime.Now.ToFileTime(), value);

is all that's necessary. The similar line in the subsequent function might also need this done to it unless it ever gets called with timestamp format and arguments. Let me know if you'd like for me to send the pull request, I'd be glad to help.

@jeremymsams

This comment has been minimized.

Copy link

commented Jun 27, 2019

Since FileTime is a long, would a formatted string be better?

writer.WriteLine("[{0}] {1}", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), value);

@amphyploid amphyploid referenced a pull request that will close this issue Jun 27, 2019

Open

Add timestamps to server log files #16731

@amphyploid amphyploid changed the title Log files do not contain timestamps Server log files do not contain timestamps Jul 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.