Skip to content

Commit

Permalink
Added documentation for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Reiche committed Jan 21, 2022
1 parent c7a3b67 commit 80e3413
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/src/docs/gettingstarted/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,37 @@ You can also change the root log level from the command line via.
----
-Dlog4j.level=DEBUG
----

== Log own messages

The `Loggable` interface provide some logging features and always uses the current instance class as logger name.

[source,java]
----
class MyClass implements Loggable {
public void doSomething() {
log().info("Do something");
}
}
----

Which results in a log message similar to

[source]
----
[main][INFO][MCID:xyz][SCID:abc]: MyClass - Do something
----

The markers `MCID` and `SCID` are referencing to the current MethodContext respectively SessionContext ID.

== Prompt messages

Very important messages can be prompted using:

[source,java]
----
log().warn("Important message", Loggable::prompt);
----

That tells the Report to display these messages in a different way (optional).

0 comments on commit 80e3413

Please sign in to comment.