Last active
August 25, 2016 07:12
-
-
Save fbaligand/bedeb87a18b876f1d057d43ee171e05c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.logstash.log; | |
import java.util.Map; | |
import org.apache.logging.log4j.core.LogEvent; | |
import org.apache.logging.log4j.core.config.plugins.Plugin; | |
import org.apache.logging.log4j.core.lookup.StrLookup; | |
@Plugin(name = "logstash", category = "Lookup") | |
public class LogstashLookup implements StrLookup { | |
private static Map<String, String> logstashSettings; | |
public static void setLogstashSettings(Map<String, String> logstashSettings) { | |
LogstashLookup.logstashSettings = logstashSettings; | |
} | |
public static Map<String, String> getLogstashSettings() { | |
return logstashSettings; | |
} | |
@Override | |
public String lookup(String key) { | |
return getLogstashSettings().get(key); | |
} | |
@Override | |
public String lookup(LogEvent event, String key) { | |
return lookup(key); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment