Skip to content

Commit 707babc

Browse files
committed
Bugfix on exception due to server not accepting datagrams on init
1 parent af07226 commit 707babc

36 files changed

Lines changed: 67 additions & 40 deletions

LoggingModule/LoggingModule.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,22 @@ public LoggingModule(
7979

8080
if (!String.IsNullOrEmpty(SyslogServerIp) && SyslogServerPort > 0)
8181
{
82-
UDP = new UdpClient(SyslogServerIp, SyslogServerPort);
82+
try
83+
{
84+
UDP = new UdpClient(SyslogServerIp, SyslogServerPort);
85+
}
86+
catch (Exception e)
87+
{
88+
Console.WriteLine("---");
89+
Console.WriteLine("");
90+
Console.WriteLine("NOTICE:");
91+
Console.WriteLine("");
92+
Console.WriteLine("Exception while initializing UDP syslog client: " + e.Message);
93+
Console.WriteLine("Syslog logging to server " + SyslogServerIp + ":" + SyslogServerPort + " is DISABLED as a result");
94+
Console.WriteLine("");
95+
Console.WriteLine("---");
96+
UDP = null;
97+
}
8398
}
8499
else
85100
{

LoggingModule/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.2.0")]
36-
[assembly: AssemblyFileVersion("1.0.2.0")]
35+
[assembly: AssemblyVersion("1.0.3.0")]
36+
[assembly: AssemblyFileVersion("1.0.3.0")]
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

LoggingModule/obj/Debug/LoggingModule.csproj.FileListAbsolute.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ D:\code\misc\SyslogLogging\SyslogLogging\bin\Debug\SyslogLogging.dll
22
D:\code\misc\SyslogLogging\SyslogLogging\bin\Debug\SyslogLogging.pdb
33
D:\code\misc\SyslogLogging\SyslogLogging\obj\Debug\SyslogLogging.dll
44
D:\code\misc\SyslogLogging\SyslogLogging\obj\Debug\SyslogLogging.pdb
5-
D:\code\misc\SyslogLogging\LoggingModule\bin\Debug\SyslogLogging.dll
6-
D:\code\misc\SyslogLogging\LoggingModule\bin\Debug\SyslogLogging.pdb
7-
D:\code\misc\SyslogLogging\LoggingModule\obj\Debug\SyslogLogging.dll
8-
D:\code\misc\SyslogLogging\LoggingModule\obj\Debug\SyslogLogging.pdb
5+
D:\code\misc\sysloglogging\LoggingModule\obj\Debug\LoggingModule.csprojResolveAssemblyReference.cache
6+
D:\code\misc\sysloglogging\LoggingModule\bin\Debug\SyslogLogging.dll
7+
D:\code\misc\sysloglogging\LoggingModule\bin\Debug\SyslogLogging.pdb
8+
D:\code\misc\sysloglogging\LoggingModule\obj\Debug\SyslogLogging.dll
9+
D:\code\misc\sysloglogging\LoggingModule\obj\Debug\SyslogLogging.pdb
Binary file not shown.
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)