Skip to content

Commit

Permalink
Added logging config for the Logger too
Browse files Browse the repository at this point in the history
Updated routing key for RabbitMQ.Client
  • Loading branch information
Keith Williams committed Mar 5, 2021
1 parent 0f3ad9e commit ccc7875
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@
@TakServerPlugin(name = "MCS COP Receiver Plugin", description = "TAK Server plugin that consumes TAK CoT messages, converts them to MCS COP messages, and sends them to the MCS COP Message Broker")
public class McsLoggerReceiverPlugin extends MessageReceiverBase {

private static final Logger logger = LoggerFactory.getLogger(McsLoggerReceiverPlugin.class);
private static final Logger _logger = LoggerFactory.getLogger(McsLoggerReceiverPlugin.class);

private Boolean _verboseLogging = false;

public McsLoggerReceiverPlugin() throws ReservedConfigurationException {
logger.info("create " + getClass().getName());
_logger.info("create " + getClass().getName());
if (config.containsProperty("verboseLogging")){
_verboseLogging = (boolean)config.getProperty("verboseLogging");
}

_logger.info("logging = " + _verboseLogging.toString());
}

@Override
public void start() {
logger.info(getClass().getName() + " started");
_logger.info(getClass().getName() + " started");
}

@Override
public void onMessage(Message message) {

logger.info("plugin message received: " + message);
if (_verboseLogging)
_logger.info("plugin message received: " + message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public McsSenderPlugin() {
if (config.containsProperty("processing_queue_size"))
_queueSize = (int)config.getProperty("processing_queue_size");

if (config.containsProperty("verboseLogging"))
VerboseLogging = (boolean)config.getProperty("verboseLogging");

_blockingQueue = new LinkedBlockingDeque<>(_queueSize);

_rabbitMqConsumer = new RabbitMQConsumer();
Expand All @@ -67,10 +70,6 @@ public void start() {
try {
_logger.info("Configuration Properties: " + config.getProperties());

if (config.containsProperty("verboseLogging")) {
VerboseLogging = (boolean)config.getProperty("verboseLogging");
}

setupConnection();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
verboseLogging : false

2 changes: 1 addition & 1 deletion TAK Server Plugin/RabbitMQ Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RabbitMQClient
class Program
{
private static string EXCHANGE = "dragonfly";
private static string ROUTING_KEY = "dragonfly.entity_locations";
private static string ROUTING_KEY = "dragonfly.demo_entities";
private static string RABBITMQ_HOSTNAME = "gsa.cognitics.net";
private static string PASSWORD = "dragonfly";
private static string USERNAME = "rapidx";
Expand Down

0 comments on commit ccc7875

Please sign in to comment.