Skip to content

Commit

Permalink
SAK-41196 Have the logger come from job configuration. (sakaiproject#…
Browse files Browse the repository at this point in the history
…6467)

The logger to use should come from the Job configuration.
  • Loading branch information
buckett authored and adrianfish committed Jan 18, 2019
1 parent 7a0c754 commit 7b869ad
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package org.sakaiproject.component.app.scheduler.jobs.logmessage;

import lombok.extern.slf4j.Slf4j;

import org.quartz.JobExecutionException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;

Expand All @@ -28,7 +28,6 @@
* This is a simple Job that allows a message to be logged.
* This is useful for testing and time stamping the log files.
*/
@Slf4j
public class LogMessageJob extends AbstractConfigurableJob {

private static final Marker fatal = MarkerFactory.getMarker("FATAL");
Expand All @@ -38,6 +37,7 @@ public void runJob() throws JobExecutionException {
String level = getConfiguredProperty("level");
String message = getConfiguredProperty("message");
String logger = getConfiguredProperty("logger");
Logger log = LoggerFactory.getLogger(logger);
if ("trace".equalsIgnoreCase(level)) {
log.trace(message);
} else if ("debug".equalsIgnoreCase(level)) {
Expand Down

0 comments on commit 7b869ad

Please sign in to comment.