File system storage saves message bodies to a local directory. Set ServiceControl/ on an Error instance, or ServiceControl. on an Audit instance, to FileSystem when the instance uses SQL Server or PostgreSQL storage.
Required settings
ServiceControl/MessageBody/FileSystem/StoragePath
Added in version 7.0.0
The directory where message bodies are stored when MessageBody/ is FileSystem.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_FILESYSTEM_STORAGEPATH |
| App config key | ServiceControl/ |
| SCMU field | MESSAGE BODY PATH |
| Type | Default value |
|---|---|
| string | None (required for file system storage) |
The ServiceControl Management Utility suggests %ProgramData%\. The PowerShell module sets this from -MessageBodyPath.
Exclude this directory from antivirus scans. See anti-virus checks.
ServiceControl.Audit/MessageBody/FileSystem/StoragePath
Added in version 7.0.0
The directory where message bodies are stored when MessageBody/ is FileSystem. Use a separate directory for each instance. The exception is Audit instances that share a database, which must all use the same directory.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_FILESYSTEM_STORAGEPATH |
| App config key | ServiceControl. |
| SCMU field | MESSAGE BODY PATH |
| Type | Default value |
|---|---|
| string | None (required for file system storage) |
The ServiceControl Management Utility suggests %ProgramData%\. The PowerShell module sets this from -MessageBodyPath.
Exclude this directory from antivirus scans. See anti-virus checks.
Optional settings
ServiceControl/MessageBody/FileSystem/DataSpaceRemainingThreshold
Added in version 7.0.0
The percentage of disk space that must remain available on the drive containing the message body storage directory. The value must be between 0 and 100.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_MESSAGEBODY_FILESYSTEM_DATASPACEREMAININGTHRESHOLD |
| App config key | ServiceControl/ |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| int | 15 (percent) |
ServiceControl.Audit/MessageBody/FileSystem/DataSpaceRemainingThreshold
Added in version 7.0.0
The percentage of disk space that must remain available on the drive containing the message body storage directory. The value must be between 0 and 100.
| Context | Name |
|---|---|
| Environment variable | SERVICECONTROL_AUDIT_MESSAGEBODY_FILESYSTEM_DATASPACEREMAININGTHRESHOLD |
| App config key | ServiceControl. |
| SCMU field | N/A |
| Type | Default value |
|---|---|
| int | 15 (percent) |
Setup and runtime
Setup creates the configured directory if it does not exist. The setup identity must be able to create the directory. The runtime identity needs read, write, and delete permissions on it. The retention sweeper deletes body files before removing the corresponding database records.
When several processes write to the same database, the path must be a shared mount. This applies to ingestion-only workers that run alongside an Error instance, and to Audit instances that share a database. Every one of these processes needs permission to read, write, and delete message body files there. Otherwise, use Azure Blob Storage or Amazon S3.
The ServiceControl Management Utility and the PowerShell module accept only a directory on a local drive as the message body path. They reject UNC paths and mapped network drives, and they ask for confirmation (-Force in PowerShell) before using a directory that already contains files. These checks apply only when one of those tools creates the instance. A container deployment can use a shared mount.
Use a durable directory or volume. Message bodies stored on a temporary or ephemeral file system are lost when it is reset, for example when a container restarts.
Setup does not check that the directory is writable: if the directory already exists but the runtime identity cannot write to it, setup succeeds and the instance fails to start up. In a container, the instance runs as a non-root user; see the container volume requirements for Error instances and Audit instances.
Set these variables in an Error instance's environment:
SERVICECONTROL_MESSAGEBODY_STORAGETYPE=FileSystem
SERVICECONTROL_MESSAGEBODY_FILESYSTEM_STORAGEPATH=/var/servicecontrol/bodies
Set these variables in an Audit instance's environment, using a different directory from any other instance, except other Audit instances that share its database:
SERVICECONTROL_AUDIT_MESSAGEBODY_STORAGETYPE=FileSystem
SERVICECONTROL_AUDIT_MESSAGEBODY_FILESYSTEM_STORAGEPATH=/var/servicecontrol/audit-bodies
See the external message body storage overview for shared configuration, retention, and backup guidance.