Skip to content

Commit

Permalink
docs(jans-cedarling): update logger docs
Browse files Browse the repository at this point in the history
Signed-off-by: Oleh Bohzok <[email protected]>
  • Loading branch information
olehbozhok committed Jan 30, 2025
1 parent 2dcc8ac commit 7076012
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/cedarling/cedarling-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,44 @@ This is set by `CEDARLING_LOG_LEVEL`
* `DEBUG`: Designates fine-grained informational events useful for debugging the application.
* `TRACE`: Provides finer-grained informational events than DEBUG. It is often used for detailed tracing of program execution.

## Memory Log interface

This interface is used to interact with the memory log storage. It provides methods for getting logs and removing them from the storage.
Same interface is translated to other languages through bindings.

Tags are used to filter logs. It can be `log_kind` and `log_level` values from log entry data.

You can obtain the `request_id` from the result structure of the `authorize` method call.

```rust
/// Log Storage
/// interface for getting log entries from the storage
pub trait LogStorage {
/// Return logs and remove them from the storage
fn pop_logs(&self) -> Vec<serde_json::Value>;

/// Get specific log entry
fn get_log_by_id(&self, id: &str) -> Option<serde_json::Value>;

/// Returns a list of all log ids
fn get_log_ids(&self) -> Vec<String>;

/// Get logs by tag, like `log_kind` or `log level`.
/// Tag can be `log_kind`, `log_level`.
fn get_logs_by_tag(&self, tag: &str) -> Vec<serde_json::Value>;

/// Get logs by request_id.
/// Return log entries that match the given request_id.
fn get_logs_by_request_id(&self, request_id: &str) -> Vec<serde_json::Value>;

/// Get log by request_id and tag, like composite key `request_id` + `log_kind`.
/// Tag can be `log_kind`, `log_level`.
/// Return log entries that match the given request_id and tag.
fn get_logs_by_request_id_and_tag(&self, request_id: &str, tag: &str)
-> Vec<serde_json::Value>;
}
```

## Jans Lock Server

In enterprise deployments, [Janssen Lock Server](../janssen-server/lock/) collects Cedarling
Expand Down

0 comments on commit 7076012

Please sign in to comment.