Title
Create new category
Edit page index title
Edit category
Edit link
Configuring Debug Logging
Overview
OESIS includes a built-in diagnostic logging facility that can be enabled at initialization time. By default, the SDK does not produce any log output. This keeps runtime overhead minimal for normal operation. When you need to investigate an issue, you can turn on full diagnostic logging by using one of two approaches:
Approaches | Mechanism | Best for |
|---|---|---|
| JSON object passed to | Programmatic integrations where you control SDK startup parameters |
| File placed in the SDK deployment directory | Quick enablement without code changes; field troubleshooting |
Both methods share the same configuration parameters and produce the same log output.
When to Use This
Enable config_debug when:
You're troubleshooting unexpected SDK behavior
OESIS Support has asked you to collect diagnostic logs
You're validating a new integration and want visibility into what the SDK is doing under the hood
You do not need config_debug for normal production use, omitting it disables debug logging entirely.
How It Works
Approach 1: config_debug (Programmatic)
Add a config_debug object to the JSON payload passed to wa_api_setup. Place it at the top level, alongside config, not nested inside it. For example:
Log Output Files
Depending on the log_mode, the SDK generates files with the following prefixes:
Encrypted Mode:
v4DebugInfo_[epoch]_[tickcount]_P[pid].logPlaintext Mode:
v4PlainTextDebugInfo_[epoch]_[tickcount]_P[pid].log
Simply including the config_debug key, even as an empty object "config_debug": {}, automatically activates debug logging using the SDK's defaults.
Approach 2: v4Debug.dat (File-Based)
Please prefer to: How do I configure v4Debug.dat for enhanced logging?
If v4Debug.dat is present, the SDK uses that configuration instead, and it overrides whatever is passed in config_debug through wa_api_setup. If your config_debug settings don't seem to be taking effect, check whether v4Debug.dat file exists.
Recommended Configuration
For most troubleshooting scenarios, we recommend setting only these categories of options and leaving everything else at its default. This ensures the widest possible diagnostic coverage, nothing gets filtered out that might turn out to be relevant.
1. Output location
Key | Type | Description |
|---|---|---|
| string | Directory where log files will be written. If omitted, logs are written in the directory containing SDK binaries ( |
2. Retention
These settings control how much disk space logging is allowed to consume, so debug logging can safely be left running without filling up storage.
Key | Type | Unit | Default (omitted) | Min | Description | |
|---|---|---|---|---|---|---|
| number | MB | 5 | 5 | Maximum size of a single log file before it rotates | |
| number | MB | 100 | 100 | Maximum total size of the log directory | |
| number | files | 0 | 20 (3) | Maximum number of rotated log files to retain | |
| number | hours | 72 | 72 | Also rotate the log after this many hours, regardless of file size |
Notes:
All upper bounds are
INT_MAX. No explicit upper limit is enforced, values are constrained only by the maximum value supported by theintdata type.Input values below the specified minimums are accepted but automatically clamped to the corresponding minimum values without generating an error or warning.
(1) For
v4PlainTextDebugInfo_*.logfiles, the rotation size is fixed at 5 MB. Any value provided indebug_log_file_sizeis ignored for plaintext logs.(2) If
debug_log_folder_sizeis set belowdebug_log_file_size, it's automatically raised todebug_log_file_size + 5.(3)
debug_log_count=0means no limit (count-based deletion is disabled entirely). The minimum of 20 only applies if you set a value between 1 - 19.
Note on Cleanup Logic (debug_log_folder_size, debug_log_count, debug_log_time):
These three retention conditions are OR'd. Whichever threshold is reached first will trigger the deletion of the oldest log files to free up space.
Warning
Automatic cleanup policies apply only to encrypted logs (v4DebugInfo_*.log).
If you enable log_mode: "plaintext" or "all", you must monitor the cleanup process to prevent disk space exhaustion.
3. Log format
Key | Type | Description |
|---|---|---|
| string | Controls which log file(s) are produced: |
If log_mode is omitted (or is set to an unrecognized value), it defaults to “encrypted". Encrypted logs are safe to leave on for extended periods but only OESIS team can decrypt them.
If you need to review the log contents yourself, set log_mode to "plaintext" or "all".
Note on Plaintext Mode:
When
log_modeis set to"plaintext", all other configuration fields are ignored, except fordebug_log_output_path.OESIS automatically redacts sensitive information (such as passwords, auth tokens, and keys) from the logs to ensure compliance with privacy standards for plaintext logs.
Plaintext logs omit some information that encrypted logs capture, which can make it harder to pinpoint the root cause of an issue. If you're sending logs to OPSWAT for investigation, encrypted (or all, which produces both) gives Support Team the most complete picture.
Optional: Narrowing the Scope
The following keys let you limit what gets logged.
Since the goal of debug logging is usually to capture a complete picture of an issue, we recommend leaving these keys below unset unless you already know exactly what you're looking for. Narrowing scope risks missing the very entry you need.
Key | Type | Description |
|---|---|---|
| string | Limits verbosity. Accepts |
| array<string> | Limits logging to specific components: |
| array<number> | Limits logging to specific signature IDs. |
| array<number> | Limits logging to specific method IDs. |
Example: Minimal Recommended Setup
This configuration:
Writes logs to
C:\Logs\OESIS.log_modeis absent, so mode stays encrypted.Per-file rotation: Each file rotates just under 10 MB.
Cleanup deletes oldest files when total size of all
v4DebugInfo_*files exceeds 200 MB, or the count reaches or exceeds 20.Any
v4DebugInfo_*file whose creation time is more than 72 hours ago is deleted.Captures all components, levels, signatures, and methods, since none of the narrowing options are set
How to Verify It's Working
After calling wa_api_setup, follow these steps to confirm logging is active:
Check the Output Directory: Navigate to your
debug_log_output_path(if set), or SDK binaries directory. A new file with the prefixv4DebugInfo_(orv4PlainTextDebugInfo_) should appear within seconds of SDK initialization.Check File Size: If the file exists but is 0 KB, ensure the SDK has performed at least one operation (like an
invoke) to generate content.
Troubleshooting "No Log File"
If no file is generated, verify the following:
Permissions: Ensure the application process has Write permissions for the target directory.
JSON Structure: Confirm
config_debugis at the top level of your JSON object, alongsideconfig, not nested inside it.Override Check: Check if a
v4Debug.datfile exists in the working directory. If it does, the SDK will ignore your programmaticconfig_debugsettings in favor of the file.
If Further Assistance is required, please proceed to log a support case or chatting with our support engineer.