<@U04UQ68083H> can you see logs and audit trails i...
# ory-copilot
b
@chilly-king-10285 can you see logs and audit trails in ory network?
c
A message from kapa.ai
Yes, Ory Network provides extensive logging and audit trails. It provides as much context as possible for each log operation. The
audience
field distinguishes between
application
logs intended for operators and developers, and
audit
logs that document allowed and denied authorizations, failed and succeeded log in attempts, and so on. Here is an example of how the logs look:
Copy code
time=2020-05-20T11:57:09+02:00 level=info msg=An example log message. audience=application service_name=foo service_version=bar   time=2020-05-20T11:57:29+02:00 level=info msg=Login successful. audience=audit service_name=foo service_version=bar
If
LOG_LEVEL=trace
, traces will be included for log calls and errors. Here is an example of a trace:
Copy code
{    "audience": "application",    "error": {    "message": "example error",    "trace": "\<http://ngithub.com/ory/x/logrusx.TestErrorTrace.func1|ngithub.com/ory/x/logrusx.TestErrorTrace.func1>\n\t/Users/foobar/go/src/github.com/ory/x/logrusx/logrus_test.go:52\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/Cellar/go/1.14.2_1/libexec/src/net/http/server.go:2012\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/Cellar/go/1.14.2_1/libexec/src/net/http/server.go:2807\nnet/http.(*conn).serve\n\t/usr/local/Cellar/go/1.14.2_1/libexec/src/net/http/server.go:1895\nruntime.goexit\n\t/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/asm_amd64.s:1373"    },    "file": "/Users/user/go/src/github.com/ory/x/logrusx/logrus_test.go:52",    "func": "<http://github.com/ory/x/logrusx.TestErrorTrace.func1|github.com/ory/x/logrusx.TestErrorTrace.func1>",    "level": "error",    "msg": "I am an example error",    "service_name": "foo",    "service_version": "bar",    "time": "2020-05-20T12:13:53+02:00"   }
For more information, you can refer to the [Ory documentation on logging](https://www.ory.sh/docs/self-hosted/operations/logging#log-fields) and [tracing](https://www.ory.sh/docs/self-hosted/operations/logging#traces).