ravendb / serilog-sinks-ravendb

A Serilog sink that writes events to RavenDB
Apache License 2.0
17 stars 16 forks source link

Can it work with RavenDB Embedded #13

Closed djordjedjukic closed 4 years ago

djordjedjukic commented 4 years ago

Can this plugin work with RavenDB Embedded version? Thanks

viceroypenguin commented 4 years ago

Yes, there is no difference between the Embedded vs the Regular version of RavenDB.

However, this library will not instantiate the embedded version for you. You would need to instantiate the RavenDB server first and then provide the connection string to this sink.

djordjedjukic commented 4 years ago

Great. One more question, is it possible to send logs in batches with delay or something similar? Or I need to implement that by myself?

viceroypenguin commented 4 years ago

By default, the sink batches 50 events over 2 seconds before sending to RavenDB. There are two parameters (batchPostingLimit for how many events, and period for maximum wait) to control this. You can provide them as desired.

djordjedjukic commented 4 years ago

Oh, I didn't look at doc carefully. Thank you

viceroypenguin commented 4 years ago

No worries! Glad I could help!

djordjedjukic commented 4 years ago

Hey, I have one more question :) I would like to use the same database for application and for logging. Do you think, that could cause some problems?

viceroypenguin commented 4 years ago

There are no problems with that, as long as you don't use the same collection for both events and application data. This sink will store log entries under the LogEvents collection, so as long as you didn't use that collection, you would be fine.

However, I would recommend two separate databases on the same server (which you can do with embedded as well), just for ease of query and separation of concerns.

djordjedjukic commented 4 years ago

OK, that's it for now. Thank you for really fast responses :)