# Log events

[Log event](https://github.com/vostok/logging.abstractions/blob/master/Vostok.Logging.Abstractions/LogEvent.cs) is the atomic unit of logging data: every act of logging produces one.

{% hint style="info" %}
Users are typically not required to create log events manually as numerous [logging extensions](https://vostok.gitbook.io/logging/concepts/syntax/logging-extensions) handle event construction, unless they are building a custom log implementation/decorator.
{% endhint %}

### Structure

Every log event consists of five components:

* **Level**

  * Levels indicate event severity:
    * **Debug**: verbose output, typically disabled in production
    * **Info:** neutral messages
    * **Warn:** non-critical errors that don't affect the normal operation of the application
    * **Error:** unexpected errors that may require human attention
    * **Fatal:** critical errors resulting in application shutdown

* **Timestamp**

  * Timestamp of the event creation. Includes timezone information.

* **Message template**

  * [Template](https://vostok.gitbook.io/logging/concepts/syntax/message-templates) of the log message that may contain placeholders to be filled with values from properties. May be absent in a valid log event.

* **Properties**

  * Arbitrary key-value data with case-sensitive string keys. May be absent in a valid log event.

* **Exception**

  * The error associated with the log event. May be absent in a valid log event.

### Immutability

Log events are effectively immutable: any changes lead to creation of a new event. `LogEvent` class provides a set of special transformation methods:

```csharp
logEvent = logEvent.WithProperty("Count", 100);
logEvent = logEvent.WithoutProperty("UselessProperty");
```

This ensures thread safety when routing the same event to multiple logs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vostok.gitbook.io/logging/concepts/log-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
