This library provides a logging system for the start, end, and error of functions. It's recommended to use it in controllers to track information about methods called timestamps, how long they took to produce a response, which service called them (if the method has a parameter named fromService), which user called them, feature code (if the method has the @Feature annotation), and potentially to view the error stacktrace.

The annotation with runtime retention is **@**LogExecution. Can be used on a function, on a property getter, on a property setter or on a class.

Logs are formatted like:

It is recommended to annotate the controller class directly with @LogExecution, so as to have the entire situation of each endpoint in the logs.

In every log is present an id that is generated at the moment you call for the first time a logging procedure. If you have the annotation, for sure will be generated immediatly before the method, whatever is the behaviour.

This id is stored in a ThreadLocal<ULID> variable and can be invoked from everywhere in the service and can be used for tracking purposes.

It can be retrieved in this way:

@Service
class MyClass {
	fun function() {
		val id: RequestId? = RequestIdProvider.requestId
	}
}

The annotation has an optional property (:ij-parameter: basePackage).

If setted, in an eventual exception stack-trace, the lines that starts with that base package will be highlighted.

If not setted, the first 2 element (like dev.tommasop1804) of the package name of the join point class is used as base package and will be highlighted.

if you don’t want any highlights, set manually to false the property :ij-parameter: includeHighlight.