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

Improve log file behaviour #1262

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ButterscotchV
Copy link
Member

I hate how logs are. Now they're better™??

Changes

  • Implemented our own FileHandler-like system
  • Logs are now tag_date_time_count.log
    • tag is specified when making the FileLogHandler instance (slimevr-server to be more descriptive)
    • date_time is the date and time from when you started the server, this could be changed but I think this makes the most sense
    • count is the file chunk from the specified limit
  • Logs can be limited any variation of:
    • Current file size (default: 25000000 (25 MB))
    • Collective file count (default: 2)
    • Collective file size (default: -1 (disabled))
  • Logs over the limits are deleted by the earliest file, found by parsing file names
  • No more log_last_0.log.lck, log_last_0.log.1, or log_last_0.log.1.lck left sitting around
  • No more losing old logs the second you launch a new server instance!
    • Collective file size could be very useful for storing a reasonably sized history of logs to help with debugging user issues, perhaps we could try using it?

Examples

Splitting with 2 count limit

image

Cumulative file size with splitting

image-1

@ButterscotchV ButterscotchV added Priority: Low Less important right now Type: Enhancement Adds or improves a feature Area: Server Related to the server labels Dec 14, 2024
@ButterscotchV ButterscotchV self-assigned this Dec 14, 2024
@ImUrX
Copy link
Member

ImUrX commented Dec 15, 2024

why is it on java?

@ButterscotchV
Copy link
Member Author

why is it on java?

Code surrounding it is Java, I can make the added class Kotlin if you want

@ImUrX
Copy link
Member

ImUrX commented Dec 15, 2024

its okay, just asking

@@ -0,0 +1,265 @@
package io.eiren.util.logging;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should move it all to dev.slimevr package tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Server Related to the server Priority: Low Less important right now Type: Enhancement Adds or improves a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants