Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
kcenon::logger::encrypted_writer Class Reference

Decorator that encrypts log data before writing. More...

#include <encrypted_writer.h>

Inheritance diagram for kcenon::logger::encrypted_writer:
Inheritance graph
Collaboration diagram for kcenon::logger::encrypted_writer:
Collaboration graph

Public Member Functions

 encrypted_writer (std::unique_ptr< log_writer_interface > wrapped, encryption_config config)
 Construct encrypted writer with wrapped writer.
 
 ~encrypted_writer () override
 Destructor - securely cleans up key material.
 
 encrypted_writer (const encrypted_writer &)=delete
 
encrypted_writeroperator= (const encrypted_writer &)=delete
 
 encrypted_writer (encrypted_writer &&)=delete
 
encrypted_writeroperator= (encrypted_writer &&)=delete
 
common::VoidResult write (const log_entry &entry) override
 Write encrypted log entry.
 
common::VoidResult rotate_key (security::secure_key new_key)
 Rotate encryption key.
 
uint64_t get_entries_encrypted () const
 Get encryption statistics.
 
std::chrono::system_clock::time_point get_last_key_rotation () const
 Get time of last key rotation.
 
- Public Member Functions inherited from kcenon::logger::decorator_writer_base
 decorator_writer_base (std::unique_ptr< log_writer_interface > wrapped, std::string_view decorator_name)
 Construct a decorator writer base.
 
 ~decorator_writer_base () override=default
 Virtual destructor for proper cleanup.
 
 decorator_writer_base (const decorator_writer_base &)=delete
 
decorator_writer_baseoperator= (const decorator_writer_base &)=delete
 
 decorator_writer_base (decorator_writer_base &&) noexcept=default
 
decorator_writer_baseoperator= (decorator_writer_base &&) noexcept=default
 
common::VoidResult flush () override
 Flush the wrapped writer.
 
std::string get_name () const override
 Get the name of this writer.
 
bool is_healthy () const override
 Check if the writer is healthy.
 
const log_writer_interfaceget_wrapped_writer () const noexcept
 Get the wrapped writer (const version)
 
- Public Member Functions inherited from kcenon::logger::log_writer_interface
virtual ~log_writer_interface ()=default
 
virtual common::VoidResult close ()
 Close the writer and release resources.
 
virtual auto is_open () const -> bool
 Check if writer is open and ready.
 

Static Public Member Functions

static result< std::string > decrypt_entry (const std::vector< uint8_t > &encrypted_data, const security::secure_key &key)
 Decrypt a single encrypted log entry.
 

Private Member Functions

common::VoidResult encrypt_data (const std::string &plaintext, std::vector< uint8_t > &output)
 Encrypt plaintext using configured algorithm.
 
common::VoidResult generate_iv (uint8_t *iv)
 Generate secure random IV.
 
bool should_rotate_key () const
 Check if key rotation is needed.
 
common::VoidResult auto_rotate_key_if_needed ()
 Perform automatic key rotation if configured.
 

Private Attributes

encryption_config config_
 
std::mutex write_mutex_
 
std::atomic< uint64_t > entries_encrypted_ {0}
 
std::chrono::system_clock::time_point last_key_rotation_
 
std::atomic< bool > is_initialized_ {false}
 

Additional Inherited Members

- Static Public Attributes inherited from kcenon::logger::decorator_writer_tag
static constexpr writer_category category = writer_category::decorator
 
- Protected Member Functions inherited from kcenon::logger::decorator_writer_base
log_writer_interfacewrapped () noexcept
 Access the wrapped writer (non-const)
 
const log_writer_interfacewrapped () const noexcept
 Access the wrapped writer (const)
 
const std::string & decorator_name () const noexcept
 Get the decorator name.
 

Detailed Description

Decorator that encrypts log data before writing.

Wraps any log_writer_interface and transparently encrypts all log data using AES-256-GCM before passing to the wrapped writer. Provides:

  • Per-entry IV rotation for semantic security
  • Authenticated encryption to prevent tampering
  • Optional key rotation
  • Secure key cleanup on destruction

Thread safety: Thread-safe when wrapped writer is thread-safe.

Category: Decorator (wraps another writer to add encryption)

Since
1.3.0
1.4.0 Added decorator_writer_tag for category classification
4.0.0 Refactored to use decorator_writer_base
Examples
decorator_usage.cpp.

Definition at line 188 of file encrypted_writer.h.

Constructor & Destructor Documentation

◆ encrypted_writer() [1/3]

kcenon::logger::encrypted_writer::encrypted_writer ( std::unique_ptr< log_writer_interface > wrapped,
encryption_config config )
explicit

Construct encrypted writer with wrapped writer.

Parameters
wrappedWriter to wrap (encrypts before delegating)
configEncryption configuration (moved)
Exceptions
std::invalid_argumentif wrapped is null or key is invalid
std::runtime_errorif initialization fails
Note
The wrapped writer receives log entries with encrypted message field. For binary file output, wrap a file_writer:
auto writer = std::make_unique<encrypted_writer>(
std::make_unique<file_writer>("secure.log.enc"),
std::move(config)
);
Since
4.0.0

Definition at line 21 of file encrypted_writer.cpp.

24 : decorator_writer_base(std::move(wrapped), "encrypted"),
25 config_(std::move(config)),
26 last_key_rotation_(std::chrono::system_clock::now())
27{
28 // Validate key size (AES-256 requires 32 bytes)
29 if (config_.key.size() != 32) {
30 throw std::invalid_argument(
31 "Invalid key size: expected 32 bytes, got " +
32 std::to_string(config_.key.size())
33 );
34 }
35
36#ifdef LOGGER_HAS_OPENSSL_CRYPTO
37 auto init_result = init_cipher_context();
38 if (init_result.is_err()) {
39 throw std::runtime_error(
40 "Failed to initialize cipher context: " +
41 get_logger_error_message(init_result)
42 );
43 }
44#endif
45
46 is_initialized_.store(true);
47
48 // Log initialization to audit log
51 "encrypted_writer initialized",
52 {{"algorithm", std::to_string(static_cast<int>(config_.algorithm))},
53 {"wrapped_writer", this->wrapped().get_name()}}
54 );
55}
decorator_writer_base(std::unique_ptr< log_writer_interface > wrapped, std::string_view decorator_name)
Construct a decorator writer base.
log_writer_interface & wrapped() noexcept
Access the wrapped writer (non-const)
std::chrono::system_clock::time_point last_key_rotation_
virtual std::string get_name() const =0
static void log_audit_event(audit_event event, const std::string &details, const std::map< std::string, std::string > &metadata={})
Log an audit event.
size_t size() const
Get key size in bytes.
std::string get_logger_error_message(const common::VoidResult &result)
Get error message from a VoidResult.
security::secure_key key
Encryption key (must be 32 bytes for AES-256)
encryption_algorithm algorithm
Encryption algorithm to use.

References config_, kcenon::logger::security::audit_logger::encryption_key_loaded, is_initialized_, kcenon::logger::encryption_config::key, kcenon::logger::security::audit_logger::log_audit_event(), and kcenon::logger::security::secure_key::size().

Here is the call graph for this function:

◆ ~encrypted_writer()

kcenon::logger::encrypted_writer::~encrypted_writer ( )
override

Destructor - securely cleans up key material.

Definition at line 57 of file encrypted_writer.cpp.

57 {
58 is_initialized_.store(false);
59
60#ifdef LOGGER_HAS_OPENSSL_CRYPTO
61 cleanup_cipher_context();
62#endif
63
64 // Flush wrapped writer
65 wrapped().flush();
66}
virtual common::VoidResult flush()=0
Flush any buffered data.

◆ encrypted_writer() [2/3]

kcenon::logger::encrypted_writer::encrypted_writer ( const encrypted_writer & )
delete

◆ encrypted_writer() [3/3]

kcenon::logger::encrypted_writer::encrypted_writer ( encrypted_writer && )
delete

Member Function Documentation

◆ auto_rotate_key_if_needed()

common::VoidResult kcenon::logger::encrypted_writer::auto_rotate_key_if_needed ( )
private

Perform automatic key rotation if configured.

Returns
common::VoidResult Success or error code

Definition at line 452 of file encrypted_writer.cpp.

452 {
453 if (!should_rotate_key()) {
454 return common::ok();
455 }
456
457 // Generate new key
458 auto key_result = security::secure_key_storage::generate_key(32);
459 if (!key_result.has_value()) {
461 key_result.error_code(),
462 key_result.error_message()
463 );
464 }
465
466 return rotate_key(std::move(key_result.value()));
467}
common::VoidResult rotate_key(security::secure_key new_key)
Rotate encryption key.
bool should_rotate_key() const
Check if key rotation is needed.
static result< secure_key > generate_key(size_t size=32)
Generate a secure random key.
VoidResult ok()
common::VoidResult make_logger_void_result(logger_error_code code, const std::string &message="")

References kcenon::logger::make_logger_void_result(), and kcenon::common::ok().

Here is the call graph for this function:

◆ decrypt_entry()

result< std::string > kcenon::logger::encrypted_writer::decrypt_entry ( const std::vector< uint8_t > & encrypted_data,
const security::secure_key & key )
static

Decrypt a single encrypted log entry.

Parameters
encrypted_dataRaw encrypted data including header
keyDecryption key
Returns
Result containing decrypted string or error
Note
Static utility method for log decryption tools

Definition at line 188 of file encrypted_writer.cpp.

191 {
192#ifdef LOGGER_HAS_OPENSSL_CRYPTO
193 // Validate minimum size (header + at least 1 byte of data)
194 if (encrypted_data.size() < sizeof(encrypted_log_header)) {
195 return result<std::string>(
197 "Encrypted data too small"
198 );
199 }
200
201 // Parse header
202 encrypted_log_header header;
203 std::memcpy(&header, encrypted_data.data(), sizeof(header));
204
205 // Validate magic number
206 if (header.magic != encrypted_log_header::kMagic) {
207 return result<std::string>(
209 "Invalid magic number in encrypted data"
210 );
211 }
212
213 // Validate version
214 if (header.version != encrypted_log_header::kVersion) {
215 return result<std::string>(
217 "Unsupported encrypted log version"
218 );
219 }
220
221 // Validate data length
222 size_t expected_size = sizeof(header) + header.encrypted_length;
223 if (encrypted_data.size() < expected_size) {
224 return result<std::string>(
226 "Encrypted data truncated"
227 );
228 }
229
230 // Initialize decryption context
231 EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
232 if (!ctx) {
233 return result<std::string>(
235 "Failed to create cipher context"
236 );
237 }
238
239 // Select cipher based on algorithm
240 const EVP_CIPHER* cipher = nullptr;
241 switch (static_cast<encryption_algorithm>(header.algorithm)) {
243 cipher = EVP_aes_256_gcm();
244 break;
246 cipher = EVP_aes_256_cbc();
247 break;
249 cipher = EVP_chacha20_poly1305();
250 break;
251 default:
252 EVP_CIPHER_CTX_free(ctx);
253 return result<std::string>(
255 "Unknown encryption algorithm"
256 );
257 }
258
259 // Initialize decryption
260 if (EVP_DecryptInit_ex(ctx, cipher, nullptr, nullptr, nullptr) != 1) {
261 EVP_CIPHER_CTX_free(ctx);
262 return result<std::string>(
264 "Failed to initialize decryption"
265 );
266 }
267
268 // Set IV length for GCM
269 if (header.algorithm == static_cast<uint8_t>(encryption_algorithm::aes_256_gcm)) {
270 if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, 16, nullptr) != 1) {
271 EVP_CIPHER_CTX_free(ctx);
272 return result<std::string>(
274 "Failed to set IV length"
275 );
276 }
277 }
278
279 // Set key and IV
280 if (EVP_DecryptInit_ex(ctx, nullptr, nullptr,
281 key.data().data(), header.iv.data()) != 1) {
282 EVP_CIPHER_CTX_free(ctx);
283 return result<std::string>(
285 "Failed to set key and IV"
286 );
287 }
288
289 // Set expected tag for GCM
290 if (header.algorithm == static_cast<uint8_t>(encryption_algorithm::aes_256_gcm)) {
291 if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, 16,
292 const_cast<uint8_t*>(header.tag.data())) != 1) {
293 EVP_CIPHER_CTX_free(ctx);
294 return result<std::string>(
296 "Failed to set authentication tag"
297 );
298 }
299 }
300
301 // Decrypt data
302 std::vector<uint8_t> plaintext(header.original_length + 16);
303 int plaintext_len = 0;
304
305 const uint8_t* ciphertext = encrypted_data.data() + sizeof(header);
306 if (EVP_DecryptUpdate(ctx, plaintext.data(), &plaintext_len,
307 ciphertext, header.encrypted_length) != 1) {
308 EVP_CIPHER_CTX_free(ctx);
309 return result<std::string>(
311 "Decryption failed"
312 );
313 }
314
315 int final_len = 0;
316 if (EVP_DecryptFinal_ex(ctx, plaintext.data() + plaintext_len, &final_len) != 1) {
317 EVP_CIPHER_CTX_free(ctx);
318 return result<std::string>(
320 "Decryption finalization failed (authentication failure)"
321 );
322 }
323
324 EVP_CIPHER_CTX_free(ctx);
325
326 plaintext_len += final_len;
327 return result<std::string>(std::string(
328 reinterpret_cast<char*>(plaintext.data()),
329 plaintext_len
330 ));
331#else
332 return result<std::string>(
334 "OpenSSL not available - decryption disabled"
335 );
336#endif
337}
encryption_algorithm
Supported encryption algorithms for log encryption.
@ aes_256_gcm
AES-256 in GCM mode (recommended)
@ aes_256_cbc
AES-256 in CBC mode (legacy support)
@ chacha20_poly1305
ChaCha20-Poly1305 (modern alternative)

References kcenon::logger::encrypted_log_header::algorithm, kcenon::logger::security::secure_key::data(), kcenon::logger::encrypted_log_header::encrypted_length, kcenon::logger::encrypted_log_header::iv, kcenon::logger::encrypted_log_header::magic, kcenon::logger::encrypted_log_header::original_length, kcenon::logger::encrypted_log_header::tag, and kcenon::logger::encrypted_log_header::version.

Referenced by kcenon::logger::log_decryptor::decrypt_file_streaming().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encrypt_data()

common::VoidResult kcenon::logger::encrypted_writer::encrypt_data ( const std::string & plaintext,
std::vector< uint8_t > & output )
private

Encrypt plaintext using configured algorithm.

Parameters
plaintextData to encrypt
outputBuffer to receive encrypted data with header
Returns
common::VoidResult Success or error code

Definition at line 339 of file encrypted_writer.cpp.

342 {
343#ifdef LOGGER_HAS_OPENSSL_CRYPTO
344 // Generate IV
345 uint8_t iv[16];
346 auto iv_result = generate_iv(iv);
347 if (iv_result.is_err()) {
348 return iv_result;
349 }
350
351 // Prepare header
352 encrypted_log_header header;
353 header.algorithm = static_cast<uint8_t>(config_.algorithm);
354 header.original_length = static_cast<uint32_t>(plaintext.size());
355 std::memcpy(header.iv.data(), iv, encrypted_log_header::kIvSize);
356
357 // Initialize encryption
358 if (EVP_EncryptInit_ex(cipher_ctx_, nullptr, nullptr,
359 config_.key.data().data(), iv) != 1) {
362 "Failed to initialize encryption"
363 );
364 }
365
366 // Allocate output buffer (header + ciphertext + potential padding)
367 size_t max_ciphertext_len = plaintext.size() + EVP_MAX_BLOCK_LENGTH;
368 output.resize(sizeof(header) + max_ciphertext_len);
369
370 // Encrypt
371 int ciphertext_len = 0;
372 if (EVP_EncryptUpdate(cipher_ctx_,
373 output.data() + sizeof(header),
374 &ciphertext_len,
375 reinterpret_cast<const uint8_t*>(plaintext.data()),
376 static_cast<int>(plaintext.size())) != 1) {
379 "Encryption update failed"
380 );
381 }
382
383 int final_len = 0;
384 if (EVP_EncryptFinal_ex(cipher_ctx_,
385 output.data() + sizeof(header) + ciphertext_len,
386 &final_len) != 1) {
389 "Encryption finalization failed"
390 );
391 }
392
393 ciphertext_len += final_len;
394 header.encrypted_length = static_cast<uint32_t>(ciphertext_len);
395
396 // Get authentication tag for GCM
398 if (EVP_CIPHER_CTX_ctrl(cipher_ctx_, EVP_CTRL_GCM_GET_TAG,
399 encrypted_log_header::kTagSize, header.tag.data()) != 1) {
402 "Failed to get authentication tag"
403 );
404 }
405 }
406
407 // Copy header to output
408 std::memcpy(output.data(), &header, sizeof(header));
409
410 // Resize to actual size
411 output.resize(sizeof(header) + ciphertext_len);
412
413 return common::ok();
414#else
417 "OpenSSL not available - encryption disabled"
418 );
419#endif
420}
common::VoidResult generate_iv(uint8_t *iv)
Generate secure random IV.
const std::vector< uint8_t > & data() const
Get const reference to key data.

References kcenon::logger::encrypted_log_header::algorithm, kcenon::logger::encrypted_log_header::encrypted_length, kcenon::logger::encrypted_log_header::iv, kcenon::logger::make_logger_void_result(), kcenon::common::ok(), kcenon::logger::encrypted_log_header::original_length, and kcenon::logger::encrypted_log_header::tag.

Here is the call graph for this function:

◆ generate_iv()

common::VoidResult kcenon::logger::encrypted_writer::generate_iv ( uint8_t * iv)
private

Generate secure random IV.

Parameters
ivBuffer to receive IV (must be 16 bytes)
Returns
common::VoidResult Success or error code

Definition at line 422 of file encrypted_writer.cpp.

422 {
423#ifdef LOGGER_HAS_OPENSSL_CRYPTO
424 if (RAND_bytes(iv, 16) != 1) {
427 "Failed to generate random IV"
428 );
429 }
430 return common::ok();
431#else
434 "OpenSSL not available"
435 );
436#endif
437}

References kcenon::logger::make_logger_void_result(), and kcenon::common::ok().

Here is the call graph for this function:

◆ get_entries_encrypted()

uint64_t kcenon::logger::encrypted_writer::get_entries_encrypted ( ) const

Get encryption statistics.

Returns
Number of log entries encrypted since creation

Definition at line 180 of file encrypted_writer.cpp.

180 {
181 return entries_encrypted_.load();
182}
std::atomic< uint64_t > entries_encrypted_

◆ get_last_key_rotation()

std::chrono::system_clock::time_point kcenon::logger::encrypted_writer::get_last_key_rotation ( ) const

Get time of last key rotation.

Returns
Timestamp of last key rotation (or construction time)

Definition at line 184 of file encrypted_writer.cpp.

184 {
185 return last_key_rotation_;
186}

◆ operator=() [1/2]

encrypted_writer & kcenon::logger::encrypted_writer::operator= ( const encrypted_writer & )
delete

◆ operator=() [2/2]

encrypted_writer & kcenon::logger::encrypted_writer::operator= ( encrypted_writer && )
delete

◆ rotate_key()

common::VoidResult kcenon::logger::encrypted_writer::rotate_key ( security::secure_key new_key)

Rotate encryption key.

Parameters
new_keyNew key to use (moved)
Returns
common::VoidResult Success or error code

Safely rotates the encryption key:

  1. Validates new key
  2. Flushes pending writes
  3. Swaps key atomically
  4. Securely clears old key
  5. Optionally logs to audit log

Definition at line 140 of file encrypted_writer.cpp.

140 {
141 // Validate new key
142 if (new_key.size() != 32) {
145 "New key must be 32 bytes for AES-256"
146 );
147 }
148
149 std::lock_guard lock(write_mutex_);
150
151 // Flush pending writes with old key
152 wrapped().flush();
153
154 // Swap keys (old key is securely cleared by secure_key destructor)
155 config_.key = std::move(new_key);
156 last_key_rotation_ = std::chrono::system_clock::now();
157
158 // Save new key if path is configured
159 if (!config_.key_rotation_path.empty()) {
161 config_.key,
164 );
165 if (save_result.is_err()) {
166 return save_result;
167 }
168 }
169
170 // Log key rotation
173 "Encryption key rotated",
174 {{"entries_encrypted", std::to_string(entries_encrypted_.load())}}
175 );
176
177 return common::ok();
178}
static common::VoidResult save_key(const secure_key &key, const std::filesystem::path &path, const std::filesystem::path &allowed_base="/var/log/keys")
Save key to file with secure permissions.
std::filesystem::path key_storage_base
Allowed base directory for key storage.
std::filesystem::path key_rotation_path
Path for key rotation (new keys saved here)

References kcenon::logger::make_logger_void_result(), kcenon::common::ok(), and kcenon::logger::security::secure_key::size().

Here is the call graph for this function:

◆ should_rotate_key()

bool kcenon::logger::encrypted_writer::should_rotate_key ( ) const
private

Check if key rotation is needed.

Returns
true if rotation interval has elapsed

Definition at line 439 of file encrypted_writer.cpp.

439 {
440 if (!config_.key_rotation_interval.has_value()) {
441 return false;
442 }
443
444 auto now = std::chrono::system_clock::now();
445 auto elapsed = std::chrono::duration_cast<std::chrono::hours>(
447 );
448
449 return elapsed >= config_.key_rotation_interval.value();
450}
std::optional< std::chrono::hours > key_rotation_interval
Optional key rotation interval.

◆ write()

common::VoidResult kcenon::logger::encrypted_writer::write ( const log_entry & entry)
overridevirtual

Write encrypted log entry.

Parameters
entryThe log entry to write
Returns
common::VoidResult Success or error code
Since
3.5.0 Changed to use log_entry directly

Implements kcenon::logger::decorator_writer_base.

Definition at line 68 of file encrypted_writer.cpp.

68 {
69 if (!is_initialized_.load()) {
72 "encrypted_writer not initialized"
73 );
74 }
75
76 // Check for automatic key rotation
77 auto rotate_result = auto_rotate_key_if_needed();
78 if (rotate_result.is_err()) {
79 // Log rotation failure but continue with current key
82 "Key rotation failed",
83 {{"error", get_logger_error_message(rotate_result)}}
84 );
85 }
86
87 // Format the log entry first
88 std::ostringstream oss;
89 auto time_t_val = std::chrono::system_clock::to_time_t(entry.timestamp);
90 std::tm tm_val;
91#ifdef _WIN32
92 localtime_s(&tm_val, &time_t_val);
93#else
94 localtime_r(&time_t_val, &tm_val);
95#endif
96
97 // Convert log_level from logger_system to common::interfaces
98 auto level = static_cast<common::interfaces::log_level>(static_cast<int>(entry.level));
99
100 oss << std::put_time(&tm_val, "%Y-%m-%dT%H:%M:%S")
101 << " [" << static_cast<int>(level) << "] "
102 << entry.message.to_string();
103
104 if (entry.location) {
105 std::string file = entry.location->file.to_string();
106 std::string function = entry.location->function.to_string();
107 if (!file.empty()) {
108 oss << " (" << file << ":" << entry.location->line << " " << function << ")";
109 }
110 }
111
112 std::string plaintext = oss.str();
113
114 // Encrypt the formatted log entry
115 std::vector<uint8_t> encrypted_data;
116 {
117 std::lock_guard lock(write_mutex_);
118 auto encrypt_result = encrypt_data(plaintext, encrypted_data);
119 if (encrypt_result.is_err()) {
120 return encrypt_result;
121 }
122 }
123
124 // Create encrypted log entry with binary data in message field
125 std::string binary_data(
126 reinterpret_cast<const char*>(encrypted_data.data()),
127 encrypted_data.size()
128 );
129 log_entry encrypted_entry(level, binary_data, entry.timestamp);
130
131 // Delegate to wrapped writer
132 auto write_result = wrapped().write(encrypted_entry);
133 if (write_result.is_ok()) {
134 entries_encrypted_.fetch_add(1);
135 }
136 return write_result;
137}
common::VoidResult auto_rotate_key_if_needed()
Perform automatic key rotation if configured.
common::VoidResult encrypt_data(const std::string &plaintext, std::vector< uint8_t > &output)
Encrypt plaintext using configured algorithm.
virtual common::VoidResult write(const log_entry &entry)=0
Write a log entry.

References kcenon::logger::get_logger_error_message(), kcenon::logger::log_entry::level, kcenon::logger::log_entry::location, kcenon::logger::make_logger_void_result(), kcenon::logger::log_entry::message, kcenon::logger::log_entry::timestamp, and kcenon::logger::small_string< SSO_SIZE >::to_string().

Here is the call graph for this function:

Member Data Documentation

◆ config_

encryption_config kcenon::logger::encrypted_writer::config_
private

Definition at line 315 of file encrypted_writer.h.

Referenced by encrypted_writer().

◆ entries_encrypted_

std::atomic<uint64_t> kcenon::logger::encrypted_writer::entries_encrypted_ {0}
private

Definition at line 318 of file encrypted_writer.h.

318{0};

◆ is_initialized_

std::atomic<bool> kcenon::logger::encrypted_writer::is_initialized_ {false}
private

Definition at line 320 of file encrypted_writer.h.

320{false};

Referenced by encrypted_writer().

◆ last_key_rotation_

std::chrono::system_clock::time_point kcenon::logger::encrypted_writer::last_key_rotation_
private

Definition at line 319 of file encrypted_writer.h.

◆ write_mutex_

std::mutex kcenon::logger::encrypted_writer::write_mutex_
mutableprivate

Definition at line 316 of file encrypted_writer.h.


The documentation for this class was generated from the following files: