Phauxth.Log (Phauxth v2.5.1) View Source

Logging functions for Phauxth.

Format

Phauxth uses logfmt to provide a standard logging format.

15:31:08.575 [warn] user=ray@example.com message="invalid password"

  • :user - the user identifier (one of email, username, nil)
  • :message - error / info message
  • :meta - additional metadata that does not fit into any of the other categories
    • this should be a keyword list

Log levels

The available log levels are :info, :warn and false.

The level at which logging starts can be configured by changing the log_level value in the config file.

The default log_level is :info, but if you only want warnings printed out, add the following to the config file:

config :phauxth,
  log_level: :warn

And if you do not want Phauxth to print out any logs, set the log_level to false.

Link to this section Summary

Functions

Returns the id of the currently logged-in user, if present.

Returns the debug log message.

Returns the error log message.

Returns the info log message.

Returns the warn log message.

Link to this section Functions

Specs

current_user_id(map() | nil) :: String.t()

Returns the id of the currently logged-in user, if present.

Returns the debug log message.

Returns the error log message.

Returns the info log message.

Returns the warn log message.