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

Index name with format date YYYY.MM instead YYYY.MM.DD #128

Open
slav4ik51493 opened this issue Nov 3, 2020 · 4 comments
Open

Index name with format date YYYY.MM instead YYYY.MM.DD #128

slav4ik51493 opened this issue Nov 3, 2020 · 4 comments
Labels

Comments

@slav4ik51493
Copy link

Hello everyone!
I have issue with rolling index names.
How I can provide my specify format of date for rolling?

I use 2.3.7.0 version.
I saw source code of 2.5.0 version and this version has public string RollingIndexNameDateFormat { get; set; } = "yyyy.MM.dd";. Okay, I can update to 2.5.0 but don't found info in docs how I can customize this RollingIndexNameDateFormat. Can you provide new version with customization this property?

If somebody know workaround - please, help me.

Thanks!

@niccolettag
Copy link

Hi!

I am having the same issue and cannot find a workaround :( Tried to add datepattern tag but it did not help.

Any input would be appreciated.

@slav4ik51493
Copy link
Author

@niccolettag I found solution, but this is not good.
I used 2.3.7 version and not found source code for this version.
I disassembly with dotPeek 2.3.7 dll and change index format rolling in Models/Uri.cs file, rebuild with Release mode.
Next, remove Nuget package from my solution and use my new, changed dll file.
This works fine. I know, hard will be update in future this library, but my project like dino :)

@bruno-garcia
Copy link
Owner

You can customize by setting the format on the appender configuration, like this:

<rollingIndexNameDateFormat value="yyyy-MM-dd" />

@gregfurman
Copy link

gregfurman commented Aug 26, 2022

You can customize by setting the format on the appender configuration, like this:

<rollingIndexNameDateFormat value="yyyy-MM-dd" />

Changing the value to "yyyy-MM" does not work and seemingly just defaults back to "yyyy-MM-dd". We are using log4net.ES v2.5.0 and log4net v2.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants