#299 - adds support for traffic channel event logging of binary or

decoded messages and event logging, as inherited from the parent
control channel's configuration.
This commit is contained in:
Denny
2017-12-11 21:07:30 -05:00
parent a3ecb339be
commit eef29d28da
4 changed files with 44 additions and 34 deletions

View File

@@ -222,7 +222,7 @@ public class DecoderFactory
if(channelType == ChannelType.STANDARD)
{
modules.add(new TrafficChannelManager(channelModel, decodeConfig,
modules.add(new TrafficChannelManager(channelModel, decodeConfig, channel.getEventLogConfiguration(),
channel.getRecordConfiguration(), channel.getSystem(), channel.getSite(),
(aliasList != null ? aliasList.getName() : null), mptConfig.getTrafficChannelPoolSize()));
}
@@ -263,7 +263,7 @@ public class DecoderFactory
if(channelType == ChannelType.STANDARD)
{
modules.add(new TrafficChannelManager(channelModel, decodeConfig,
modules.add(new TrafficChannelManager(channelModel, decodeConfig, channel.getEventLogConfiguration(),
channel.getRecordConfiguration(), channel.getSystem(), channel.getSite(),
(aliasList != null ? aliasList.getName() : null), p25Config.getTrafficChannelPoolSize()));
}

View File

@@ -1,33 +1,38 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package module.log;
import module.Module;
import module.log.MessageEventLogger.Type;
import module.log.config.EventLogConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import properties.SystemProperties;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import module.Module;
import module.log.MessageEventLogger.Type;
import module.log.config.EventLogConfiguration;
import properties.SystemProperties;
public class EventLogManager
{
private final static Logger mLog = LoggerFactory.getLogger(EventLogManager.class);
private Path mDirectory;
public EventLogManager()

View File

@@ -80,8 +80,6 @@ public abstract class EventLogger extends Module
mLogFileName = sb.toString();
mLog.info("Creating log file:" + mLogFileName);
mLogFile = new OutputStreamWriter(new FileOutputStream(mLogFileName));
write(getHeader());
@@ -125,14 +123,17 @@ public abstract class EventLogger extends Module
protected void write(String eventLogEntry)
{
try
if(mLogFile != null)
{
mLogFile.write(eventLogEntry + "\n");
mLogFile.flush();
}
catch(IOException e)
{
mLog.error("Error writing entry to event log file", e);
try
{
mLogFile.write(eventLogEntry + "\n");
mLogFile.flush();
}
catch(IOException e)
{
mLog.error("Error writing entry to event log file", e);
}
}
}
}