Skip to content

Allow log file to have ".log" or custom file extension #2672

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

Open
sloganking opened this issue Aug 3, 2023 · 5 comments
Open

Allow log file to have ".log" or custom file extension #2672

sloganking opened this issue Aug 3, 2023 · 5 comments

Comments

@sloganking
Copy link

sloganking commented Aug 3, 2023

Feature Request

Crates

tracing-appender

Motivation

Functions like tracing_appender::rolling::daily() have an argument for file_name_prefix but none for file_name_suffix or file_extension. From what I can tell, there is currently no current method to have tracing write to log files that have the .log file extension. This is quite annoying as other programs make use of the .log extension. This includes bat and vscode which syntactically highlight .log files. But not files created by tracing since tracing does not create files with the .log extension.

Proposal

Allow users to tell tracing to give their log files the .log extension. Or allow them to specify the file extension they would like their log files to have.

@IceSentry
Copy link
Contributor

This was done in this PR #2225 but for reasons I don't know tracing-appender hasn't been released in over a year.

@ptdecker
Copy link

Seems related to #2701 too

@IceSentry
Copy link
Contributor

Seems related to #2701 too

I'm not sure that would solve that issue. A custom extension would still use the date time stamp in the middle like debug.2023-09-13.log

@sloganking
Copy link
Author

@IceSentry

This was done in this PR #2225 but for reasons I don't know tracing-appender hasn't been released in over a year.

It looks like there was a release 5 days ago

image

I have yet to check but does anyone know if the release contains #2225 and fixes this issue?

@jtojnar
Copy link

jtojnar commented Feb 13, 2024

I have yet to check but does anyone know if the release contains #2225 and fixes this issue?

It does. You need to set it through the new builder API.

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

4 participants