ExAthena.LogFile (ExAthena v0.17.0)

Copy Markdown View Source

Optional file logging for the athena.web / athena.chat mix tasks.

Attaching adds an Erlang :logger file handler alongside the default console handler, so the same log output the tasks print to the terminal is also written to a file (handy for sharing/inspecting after the fact). Enabled via the tasks' --log [PATH] flag.

Summary

Functions

Attaches a file logger handler writing to path (default log/phoenix_output.log).

The path used when --log is given without an explicit value.

Removes the file logger handler if attached. Safe to call when absent.

Functions

attach!(path \\ "log/phoenix_output.log")

@spec attach!(String.t()) :: String.t()

Attaches a file logger handler writing to path (default log/phoenix_output.log).

Creates the parent directory, captures :debug and up (so LiveView HANDLE EVENT lines are included), and returns the expanded path. Re-attaching replaces any previously attached handler.

default_path()

The path used when --log is given without an explicit value.

detach()

@spec detach() :: :ok

Removes the file logger handler if attached. Safe to call when absent.