-
Notifications
You must be signed in to change notification settings - Fork 794
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
ElasticSearchSink durability - rolling file problem #531
Comments
Do you use your ILogger as a singleton? |
Yes, I suppose. Should that be avoided? |
No, it should be a singleton. The file locking error commonly appears when it's not used as a singleton There was a common, but incorrect, pattern where the same logging configuration instance is used to generate multiple logger instances. Recent releases of Serilog (in the past month or so) throw an exception if this occurs so you fail early. Given that's probably not your problem I guess some more sleuthing is required. Do you have multiple copies of your ASP.Net app pool running, such as a web garden? Is this a consistent problem or just occasional? I don't know enough about the bookmark file maintenance but it does seem like there may be two problems here - the locked file (see above commentary & questions) and the bookmark file not being made aware of the "next in sequence" file. The latter sounds like it might be a bug. |
I might be mistaken, but from quickly browsing the source code, I cannot find how the code would update the bookmark file in the situation where the RollingFileSink have increased the file index. |
Moved to: serilog-contrib/serilog-sinks-elasticsearch#27 (see #450) |
We have set up the ELS sink with durability in our ASP.NET application (running on IIS / Win2012 R2). We have also added a max size on the file, so that it will roll the files if they become too big. Our configuration is as follows:
Looking at the buffer files, we noticed that the
.bookmark
file appearently does not take the_001.json
file into account. Here's the files:Looking at the last write times, we see that the
_001.json
file has been written to, but the.bookmark
file has not. Here's the contents of the.bookmark
file:Furthermore, we got the following entry in the self-log:
This is the only entry in this file.
Any ideas about what's going on?
The text was updated successfully, but these errors were encountered: