-
Notifications
You must be signed in to change notification settings - Fork 148
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
Issue - No log entry written when message is too long #209
Comments
Possible solution to this problem would be: In
Of course this approach needs to be generalized and the max length and the string should be the parameter. This way such a utility method (e.g. Furthermore, I think one should use the SelfLog to inform about truncated messages so the consumer of the library has a chance to find out what is going on under the hood. |
Thank you for reporting this. Is it possible for you to send us a pull request including tests? |
Is there a way to highlite this issue as critical bug (according to principle of less surprise) and mention in documentation in red? Production databases rarely refactored, so there is no way for me to use nvarchar(max) in nearest years. This issue also makes main feature (structured logs) - auto-serialization not usable, for every column I need to serialize data manually and then truncacte it to specific value. |
Added information about batched sink SqlBulkCopy behavior according to issue #209.
When using the batched sink ( I'm still open for a PR like suggested above to do at least a truncation of input data when configured in the column options. Furthermore I don't think that this is a critical bug of the sink but it is by design of the underlying |
Message trimming can be used to avoid this case. Closing this issue. |
Bug Report / Support Request Template
We have an existing logs table which has some indexed columns for lookup and searching. Due to the required index, those columns (e.g. the message column) also have a max-length parameter set.
However when logs are written that have a message which is longer, these messages are not written to the server.
The sink actually fails in the bulk copy operation
WriteToServerAsync
because of anThe same message you will see when enabling Serilogs SelfLog.
However, the inner exception message would be more helpful in my opinion:
Maybe in combination with a
SelfLog.WriteLine
warning about truncated messages.Currently however I don't seem to have a possibility to control this from outside or modify the log message before it enters the sink (which is actually not an option as we use a file sink simultaneously where the entire message shall be written to).
OS: Windows 10
WriteToServerAsync
The text was updated successfully, but these errors were encountered: