# logWrite()

Almost everything in saaster is logged. With this function you can also log your own applications.

The word combination *logWirte* may sound illogical at first; it would be better to use the name *writeLog*. The problem is, however, that the word combination *writeLog* is used directly by Lucee, which is why we simply wrote logWrite.

The function creates a text file in the folder "logs", separated with further folders, which are provided with the date (yyyy-mm). Within the respective folder, the text file is again named with today's date (day). There is a new text file for each day.

**Example 1**: */logs/2022-12/05.log*\
**Example 2**: */logs/2023-02/13.log*

<table><thead><tr><th width="221"></th><th></th></tr></thead><tbody><tr><td><strong>name</strong></td><td>the name of the given function to log</td></tr><tr><td><strong>severity</strong></td><td>"INFORMATION", "WARNING", "ERROR", "FATAL"</td></tr><tr><td><strong>message</strong></td><td>the given message such as an error message</td></tr><tr><td><strong>sendMail</strong></td><td>whether we should send an email to the administrator</td></tr></tbody></table>


---

# 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://docs.saaster.io/development/develop-with-saaster/global-functions/logwrite.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.
