Configuration

Structured Tracing

Runique exposes an opt-in, per-domain tracing system via RuniqueLog. Each domain activates independently — nothing is logged by default.

Quick activation in development

RuniqueApp::builder(config)
    .with_log(|l| l.dev())   // everything at DEBUG if DEBUG=true
    // ...

.dev() is a no-op if DEBUG is not true — safe to use unconditionally.


Granular configuration

.with_log(|l| l
    .forms(|f| f
        .validate(Level::DEBUG)
        .finalize(Level::DEBUG)
    )
    .admin(|a| a
        .crud(Level::INFO)
        .auth(Level::WARN)
    )
    .auth(|a| a
        .login(Level::INFO)
        .reset(Level::WARN)
    )
    .mailer(|m| m.send(Level::INFO))
    .builder(|b| b
        .templates(Level::INFO)
        .middleware(Level::DEBUG)
        .routes(Level::INFO)
        .statics(Level::INFO)
    )
    .rate_limit(Level::WARN)
)

Available domains

forms — Form pipeline

FieldWhenLogged data
fieldField registrationname, type, required
set_valueValue assigned by fill()name, value (password masked)
validateValidation resultfield, ok/error, global error count
renderHTML renderingfield, ok/error
finalizeHash/file movefield, ok/error

admin — Admin panel

FieldWhenLogged data
authAccess check + CSRF failresource, action
crudDispatch + create/edit/delete resultresource, action, ok/error
listDispatch + list resultresource, rows, total, page
bulkBulk actionsresource, action

auth — Authentication

FieldWhenLogged data
loginSession creationuser_id, username, is_superuser, exclusive, db_persist
resetPassword reset flowemail, step (token generated / email sent / invalid / ok / error)

mailer

FieldWhenLogged data
sendEmail dispatchbackend, to, subject, ok/error

builder — Startup (one-time)

FieldWhenLogged data
templatesTera loadinginternal, user, total
registryAdmin resourcescount
middlewareMiddleware stackcount + slot + name for each entry
routesURL registrycount
staticsStatic filesstatic_url, static_dir, media_url, media_dir

Flat fields on RuniqueLog

FieldWhenLogged data
rate_limitRequest blockedip, retry_after
csrfCSRF token detected in a GET URLpath
sessionSession store operationsevent
dbDatabase queriesquery, duration
host_validationHost rejectedhost

Unconditional errors (always active)

Regardless of tracing config, some errors are always logged via tracing::error!:

  • Invalid template — if a Tera template fails to load, the template name and error (including line number) are logged before startup aborts.