Hi, Andrey!
I'm looking for a best way to add an encryption. The idea is to have the records to be put encrypted into the file.
I've read the tutorial how to extend the lib with an own sink. But there's also a text_file_backend which I would like to use. It does pretty much all I need, except the final encryption.
I had an idea to override operator << for sinks::text_file_backend::stream_type and let Koenig search to do the job, but then discovered that you used m_file.write. And that you've mentioned that it's not a "pure stream" in the tutorial
Do you have any suggestions on this matter? Maybe there's a trick I've missed?
Thanks for a great lib.
Best regards,
Artyom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As a quick solution you could use text_ostream_backend with your own stream that does encryption. But you won't have file rotation this way. If you need rotation then I'm afraid, right now the only way is to implement your own sink backend.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, that's what I've figured.
Yet the rotation, collecting the files thru min_free_space, setting the header thru set_open_handler are the options I also would like to have.
So I'll consider the option with own sink then. Thanks for your reply
Last edit: erithion 2013-07-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, Andrey!
I'm looking for a best way to add an encryption. The idea is to have the records to be put encrypted into the file.
I've read the tutorial how to extend the lib with an own sink. But there's also a text_file_backend which I would like to use. It does pretty much all I need, except the final encryption.
I had an idea to override operator << for sinks::text_file_backend::stream_type and let Koenig search to do the job, but then discovered that you used m_file.write. And that you've mentioned that it's not a "pure stream" in the tutorial
Do you have any suggestions on this matter? Maybe there's a trick I've missed?
Thanks for a great lib.
Best regards,
Artyom
As a quick solution you could use text_ostream_backend with your own stream that does encryption. But you won't have file rotation this way. If you need rotation then I'm afraid, right now the only way is to implement your own sink backend.
yes, that's what I've figured.
Yet the rotation, collecting the files thru min_free_space, setting the header thru set_open_handler are the options I also would like to have.
So I'll consider the option with own sink then. Thanks for your reply
Last edit: erithion 2013-07-24
erithion, I think it's never too late to improve logger at Your product.
You can use any backend You want with this solution:
https://sourceforge.net/p/boost-log/discussion/710021/thread/f2096561/