Skip to content

Commit

Permalink
Merge pull request #97 from r-duran/develop
Browse files Browse the repository at this point in the history
Make plugin directory configurable.
  • Loading branch information
Lennart Koopmann committed Oct 16, 2012
2 parents 68ffb6e + 84b9372 commit d98664c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions misc/graylog2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# instances as master. The master will perform some periodical tasks that non-masters won't perform.
is_master = true

# Set plugin directory here
plugin_dir = /opt/graylog2-server/plugin

# On which port (UDP) should we listen for Syslog messages? (Standard: 514)
syslog_listen_port = 514
syslog_listen_address = 127.0.0.1
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/graylog2/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ public class Configuration {

@Parameter(value = "twilio_sender", required = false)
private String twilioSender = "";

@Parameter(value = "plugin_dir", required = false)
private String pluginDir = "plugin";

public boolean isMaster() {
return isMaster;
Expand Down Expand Up @@ -473,6 +476,10 @@ public String getTwilioAuthToken() {
public String getTwilioSender() {
return twilioSender;
}

public String getPluginDir() {
return pluginDir;
}

@ValidatorMethod
public void validate() throws ValidationException {
Expand All @@ -483,4 +490,4 @@ public void validate() throws ValidationException {
}
}

}
}
2 changes: 1 addition & 1 deletion src/main/java/org/graylog2/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void run() {
}

private void loadPlugins() {
PluginLoader pl = new PluginLoader("plugin");
PluginLoader pl = new PluginLoader(configuration.getPluginDir());
for (Class<? extends MessageFilter> filter : pl.loadFilterPlugins()) {
LOG.info("Registering plugin filter [" + filter.getSimpleName() + "].");
registerFilter(filter);
Expand Down

0 comments on commit d98664c

Please sign in to comment.