const mixinafIoc::LogProvider
afIoc::LogProvider : afIoc::DependencyProvider
(Service) - A DependencyProvider that injects Log
instances.
For field injection LogProvider
reuses the @Inject
facet:
@Inject Log log
By default, the class's pod name is used to create the log instance. In essence this is:
target.typeof.pod.log
Custom log names may be provided via the @Inject.id
parameter:
@Inject { id="my.log.name" } Log log
You may also create a LogProvider
with a custom log function. Example, to override the default LogProvider
with one that generates log names based on the target type (and not pod):
class AppModule { @Override static LogProvider overrideLogProvider() { LogProvider.withLogFunc |Type type->Log| { Log.get(type.name) } } }