Package org.apache.ignite.resources
Annotation Type LoggerResource
-
@Documented @Retention(RUNTIME) @Target({METHOD,FIELD}) public @interface LoggerResource
Annotates a field or a setter method for injection ofIgniteLogger
. Grid logger is provided to grid viaIgniteConfiguration
.Logger can be injected into instances of following classes:
Here is how injection would typically happen:
public class MyGridJob implements ComputeJob { ... @LoggerResource private IgniteLogger log; ... }
orpublic class MyGridJob implements ComputeJob { ... private Ignite log; ... @LoggerResource public void setGridLogger(IgniteLogger log) { this.log = log; } ... }
See
IgniteConfiguration.getGridLogger()
for Grid configuration details.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class
categoryClass
Optional log category class.String
categoryName
Optional log category name.
-
-
-
Element Detail
-
categoryClass
Class categoryClass
Optional log category class. If not provided (i.e. by defaultVoid
class is returned), then the category will be the class into which resource is assigned.Either
categoryClass
orcategoryName()
can be provided, by not both.- Returns:
- Category class of the injected logger.
- Default:
- java.lang.Void.class
-
-
-
categoryName
String categoryName
Optional log category name. If not provided, thencategoryClass()
value will be used.Either
categoryName
orcategoryClass()
can be provided, by not both.- Returns:
- Category name for the injected logger.
- Default:
- ""
-
-