---
title: "Loading modules"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-configuration-file/modules/modules-loading/"
last_modified: "2023-07-02T20:37:04+02:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# Loading modules

The AxoSyslog application loads every available module during startup.

To load a module that is not loaded automatically, include the following statement in the AxoSyslog configuration file:

```shell
   @module <module-name>
```

Note the following points about the `@module` statement:

- The `@module` statement is a top-level statement, that is, it cannot be nested into any other statement. It is usually used immediately after the `@version` statement.
- Every `@module` statement loads a single module: loading multiple modules requires a separate `@module` statement for every module.
- In the configuration file, the `@module` statement of a module must be earlier than the module is used.

> **Note:**
>
> To disable loading every module automatically, set the `autoload-compiled-modules` global variable to `0` in your configuration file:
>
> ```shell
>    @define autoload-compiled-modules 0
> ```
>
> Note that in this case you have to explicitly load the modules you want to use.

## Use the @requires statement to ensure that the specified module is loaded

To ensure that a module is loaded, include the following statement in the AxoSyslog configuration file or the external files included in the configuration file:

```shell
   @requires <module-name>
```

> **Note:**
>
> If you include the `@requires` statement in the:
>
> - AxoSyslog configuration file, AxoSyslog attempts to load the required module. If it fails to load the module, AxoSyslog stops and an error message is displayed.
> - external files included in the configuration file, AxoSyslog attempts to load the required module. If it fails to load the module, only the external file is not processed.
>
> Note that this is not true for modules marked as mandatory. You can make a dependency module mandatory by defining an error message after the `@requires <module-name>` statement, for example:
>
> ```shell
> Example
> @requires http "The http() driver is required for elasticsearch-http(). Install syslog-ng-mod-http to continue."
> ```

Last modified July 2, 2023: [Change highlight mode of code examples (2f8a9593)](https://github.com/axoflow/axosyslog-core-docs/commit/2f8a95937c6498193e7168ce8b0dc831e9f0f8ad)
