Skip to content

Configuration Reference

Reference: the complete key table.

Resolution

  1. -Dkey=value command-line overrides (and programmatic AppConfig.set) — checked first on every read, the engines' f:setConfig analog.
  2. The configuration file: resources/application.yml | .yaml | .properties next to the application file (the file mercury-serve is given, or the script python app.py ran), never in the working directory; or --config <path>.
  3. ${ENV_VAR:default} substitution inside values: the environment variable first, then the configuration key of that name — a -D override of it before the file's value, as a key is read — then the default. A reference that leads back to a key being resolved is logged (Config loop for 'key' detected, as the engines log it) and has no value, so its default stands. A value its references leave empty is no value either, as in the Java engine: with llm.effort: '${LLM_EFFORT:}' and the variable unset, the key reads as its default — the idiom for an optional setting — while an empty text written as one (key: '') stays one.

How a YAML file is read

Every YAML file of the pack — application.yml, rest.yaml, app-log-context.yaml, an extension's own file — is read by YAML 1.2.2, the same way by the Python pack and the Node.js pack. A scalar written without quotes is resolved by the core schema of the specification (section 10.3.2), its rows tried in this order:

Written Read as
nothing, ~, null, Null, NULL no value: the key reads as a key that is not there, so its default applies
true, True, TRUE, false, False, FALSE a boolean
[-+]?[0-9]+ — 16000, -5, 010 an integer in base 10, exact at any size: 010 is 10
0o[0-7]+ — 0o17 an integer in base 8
0x[0-9a-fA-F]+ — 0x1F an integer in base 16
[-+]?[0-9]+(\.[0-9]*)?([eE][-+]?[0-9]+)? with a point or an exponent, or [-+]?\.[0-9]+([eE][-+]?[0-9]+)? — 1.5, 16000.0, 1e3, .5 a float
.inf, .Inf, .INF, also with a sign; .nan, .NaN, .NAN a float
anything else, and anything in quotes text

So yes, no, on, off, y and n, a number with an underscore (16_000), in base 2 (0b101) or in base 60 (1:30), -0x10, a date (2026-11-30), = and << are text, and << as a key is a key like any other, not the merge key. A switch or a flag written yes is refused by name (rest.automation must be true or false), never read as on and never as off. Under an explicit tag a scalar is valid when the tag is one of the core schema's (!!str, !!int, !!float, !!bool, !!null) and its content one of that tag's rows; a file with any other tag (!!binary, !!timestamp, !!set) does not load.

Write YAML 1.2.2, and none of the additional syntax of YAML 1.1

This is the recommendation for whoever writes a file, a developer or an AI assistant. The Java engine's reader (SnakeYAML) reads YAML 1.1 and still accepts the older syntax, so a file that uses it reads one way in the Java engine and another way in the packs. The Rust engine reads YAML 1.2 as well; its library departs from the core schema in three spellings, which the table shows:

Do not write The Java engine reads The Rust engine reads The packs read Write
yes, no, on, off a boolean text text true, false
010, 08 8 (base 8), text text 10, 8 10, 8 — or '010' when it is text
0o10 text 8 8 8
0b101 5 5 text 5
-0x10 -16 -16 text -16
1:30 90 (base 60) text text 90 — or '1:30' when it is text
16_000 16000 text text 16000
2026-11-30 a date, written in the time zone of its JVM text text '2026-11-30'
<<: *base the merge key a key named << a key named << the keys themselves

yes/no/on/off, 0b101, 1:30, 16_000 and the merge key are syntax of YAML 1.1 only. A number with a leading zero (010, 08), 0o10 and an unquoted date are valid YAML 1.2.2 and are to be avoided all the same, because the Java engine reads them another way and the Rust engine keeps a number with a leading zero as text. y and n, booleans in YAML 1.1 itself, are text in every runtime. The forms every runtime reads alike: true and false; a plain decimal number without a leading zero, an underscore or a colon (16000, -5, 1.5, 1e3); 0x for base 16 (0x1F); and quotes around any text that could be read as a boolean, a number, a date or no value ('true', '010', '1e3', '2026-11-30', 'null').

The text of a value

As text — what get_property returns, and what a reference inside a longer text is replaced by — a boolean is true or false and a float keeps its point (1.0, never 1), so info.app.version: 1.0 reads 1.0 in both packs; a float is written as Python writes one, which is the Java engine's text too between 0.001 and 10,000,000. A mapping key YAML read as something other than text (True:, 8080:) is the text of that value (true, 8080). A tab is read as two spaces, as the Java engine reads a file, so one indented with tabs loads. A file whose document is not a mapping has no keys, and the last of two equal keys stands.

A number, a duration and a switch

The settings of the host read these by one rule, the same in both packs; a value that is none of them stops the start by name instead of being read as off or as a default:

  • a whole number — a number with a whole value (16000, 16000.0), or text of the digits 0-9 with white space around them at most, up to 9007199254740991. A sign, an underscore, a point or an exponent in text and a digit of another script are refused (rest.upload.max.bytes must be a whole number >= 0);
  • a duration — such a number, in seconds, or the number and, right after it, one of ms, s, m, h, d: 30, 30s, 500ms, 2m (event.stream.keep.alive must be a duration such as 30s, 2m or 500ms (seconds, ms, s, m, h, d), or 0 for none);
  • a switch — the boolean true or false, or that text in any letter case; no value and an empty one are the default (rest.automation must be true or false).

Well-known keys (shared with the engines)

Key Meaning Default
application.name application identity in logs, /info and /health application
rest.server.port Event API + actuator port: a whole number up to 65535, 0 for one the system picks 8085
log.format text, json (pretty-printed) or compact (single-line JSONL) text
log.level log level; the LOG_LEVEL environment variable wins. A trace record is written whatever the level says, and DEBUG is a development setting (what the log holds) INFO
app.log.context the application log context: a context block on every structured log line inside a traced request (guide); a switch — false opts out, any value but true or false stops the start true
info.app.version version reported by /info package version
info.app.description description reported by /info application.name
show.env.variables opt-in list of environment variables shown by /env (empty)
show.application.properties opt-in list of configuration keys shown by /env (empty)
mandatory.health.dependencies routes of health check functions that decide /health (empty)
optional.health.dependencies health check routes reported but never affecting status (empty)
rest.automation REST automation on: the entries of rest.yaml served in front of the functions (guide); a switch — any value but true or false stops the start false
yaml.rest.automation the one location of rest.yaml: classpath: the resources folder, file: an absolute path, a relative path under the application file's folder classpath:/rest.yaml
rest.upload.max.bytes the bound on one upload: its files and its text fields together, counted in bytes (413 beyond it); a whole number 16777216
http.trace.id.header the trace-id header a traced entry reads when no W3C traceparent arrives (trace.id.header overrides it per entry) X-Trace-Id
http.correlation.id.header the business correlation-id header, always ensured and echoed (correlation.id.header per entry) X-Correlation-Id
http.traceparent.header a custom name for the W3C traceparent header, read only when the standard one is absent (traceparent.header per entry) traceparent
event.stream.keep.alive the keep-alive comment interval of a Server-Sent Events reply (/api/event and streaming entries): a duration up to 2147483647 ms (about 24.8 days, the longest a timer of the Node.js pack holds); 0 disables 30s
static.html.folder the folder of static web content the host serves for the paths nothing else claims — relative to the application file's folder (guide) resources/public
otel.forwarding the OpenTelemetry forwarder's master switch (guide); a switch — any value but true or false stops the start false
otel.exporter.otlp.endpoint the OTLP/HTTP traces URL including the signal path; a URL that holds a user id and a password stops the start http://localhost:4318/v1/traces
otel.exporter.otlp.headers request headers, k=v or k: v, comma-separated (re-read per export) (none)
otel.exporter.otlp.timeout per-export timeout in milliseconds 10000
otel.exporter.otlp.connect.timeout connect timeout in milliseconds the client default
otel.exporter.otlp.compression only none is honoured (a warning otherwise) none
otel.service.name the service.name resource attribute of exported spans application.name

List-valued keys accept a comma/space-separated string (engine syntax) or a YAML list.

Programmatic access

from mercury_composable import app_config

config = app_config()
port = config.get("rest.server.port", 8085)
name = config.get_property("application.name", "application")
config.set("feature.flag", "on")     # runtime override, checked first