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

Add option to enabling writing logs to a file #51

Open
Maxi-Mega opened this issue Dec 27, 2021 · 3 comments
Open

Add option to enabling writing logs to a file #51

Maxi-Mega opened this issue Dec 27, 2021 · 3 comments
Labels
enhancement New feature or request (not a bug) priority/low Low priority task

Comments

@Maxi-Mega
Copy link

I have two suggestions regarding the logging of the Gate proxy:

  • It would be nice to have the possibility to choose what we want in the logs. For example, in production I don't think the path of the file and the line from which the logger was called is any useful information. Maybe the ability to choose the format of the date would be interesting too, for instance if we want to be able to process the logs with an other application... which leads us to the second point.
  • Save the logs to a file, like any regular Minecraft proxy or server. For now, the only way I found to do that is to redirect manually the program outputs to a file like so: ./gate > logs.txt 2>&1, but color codes are not supported and render like this: �[34m.

Thanks for your reading

@robinbraemer robinbraemer added the enhancement New feature or request (not a bug) label Dec 31, 2021
@R167
Copy link
Contributor

R167 commented Jan 13, 2022

On a related note, the logging library github.com/go-logr/logr is now on v1 (no longer v0) which broke the build when I naively updated my transient dependencies 😅

@robinbraemer robinbraemer added this to the Nonurgent milestone Mar 1, 2022
@robinbraemer
Copy link
Member

@R167 github.com/go-logr/logr dependency is now updated in the new release

@robinbraemer
Copy link
Member

I have two suggestions regarding the logging of the Gate proxy:

  • It would be nice to have the possibility to choose what we want in the logs. For example, in production I don't think the path of the file and the line from which the logger was called is any useful information. Maybe the ability to choose the format of the date would be interesting too, for instance if we want to be able to process the logs with an other application... which leads us to the second point.
  • Save the logs to a file, like any regular Minecraft proxy or server. For now, the only way I found to do that is to redirect manually the program outputs to a file like so: ./gate > logs.txt 2>&1, but color codes are not supported and render like this: �[34m.

Thanks for your reading

Hello, you can always make use of

func SetLogger(l Logger) {

Or setup a Gate instance specifying your own Logger

Logger logr.Logger

@robinbraemer robinbraemer changed the title Logging features Support writing logs to a file Mar 8, 2022
@robinbraemer robinbraemer added the priority/low Low priority task label Mar 17, 2023
@robinbraemer robinbraemer removed this from the Nonurgent milestone Apr 10, 2023
@robinbraemer robinbraemer changed the title Support writing logs to a file Add option to enabling writing logs to a file Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request (not a bug) priority/low Low priority task
Projects
None yet
Development

No branches or pull requests

3 participants