Skip to main content

Logging system

This section describes the configuration and usage of Melezh's built-in logging system.

Incoming request logging

By default, new Melezh projects have logging enabled - collecting and storing information about incoming requests and responses. Logs are saved as separate files in a specific directory structure.

The default log directory is located at temp/Melezh/<Project Random UUID>. You can find or modify this path either through the web interface settings panel or via console commands.

The log directory hierarchy is organized as follows:

  • Handler directory
    • Date directory (stores logs for a specific day)
      • Request-specific directory

Log files are only stored in request-specific directories, while other levels contain only nested subdirectories.

Log file format

Each request directory may contain the following file types:

  • req.info - JSON file with core event information (timestamp, HTTP method, URL parameters, etc.)
  • req.body - JSON file containing the request body (original JSON for application/json requests or converted JSON for form-data)
  • req.header - JSON file with request headers
  • res.body - Response body returned by Melezh
  • Any number of additional files from multipart/form-data requests

The specific files created depend on the request type and logging configuration settings.

Logging configuration

Melezh provides several logging options to control storage location and content:

  • logs_path - Log storage directory. Set empty to disable logging
  • logs_req_headers - Enable/disable request header logging
  • logs_req_body - Enable/disable request body logging
  • logs_req_max_size - Maximum request body size to log (in bytes). 0 = unlimited
  • logs_res_body - Enable/disable response body logging
  • logs_res_max_size - Maximum response body size to log (in bytes). 0 = unlimited
tip

Direct file system access to logs may be inconvenient. For viewing events and searching specific requests, we recommend using the built-in web interface log viewer (see Web Interface section).