Skip to content

Commit 47a234d

Browse files
committed
NuGet v1.0.6, limit msg size to 1024 bytes
1 parent c9fd624 commit 47a234d

35 files changed

Lines changed: 71 additions & 30 deletions

.vs/SyslogLogging/v14/.suo

-512 Bytes
Binary file not shown.

LoggingModule/LoggingModule.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,22 @@ public void Close()
125125

126126
public void Log(Severity sev, string msg)
127127
{
128+
if (String.IsNullOrEmpty(msg)) return;
129+
128130
string message = "";
131+
string currMsg = "";
132+
string remainder = "";
133+
134+
if (msg.Length > 1024)
135+
{
136+
currMsg = msg.Substring(0, 1024);
137+
remainder = msg.Substring(1024, (msg.Length - 1024));
138+
}
139+
else
140+
{
141+
currMsg = msg;
142+
}
143+
129144
if (IncludeUtcTimestamp) message += DateTime.Now.ToUniversalTime().ToString("MM/dd/yyyy HH:mm:ss") + " ";
130145
if (IncludeSeverity) message += sev.ToString() + " ";
131146
if (IncludeHostname) message += Hostname + " ";
@@ -143,7 +158,7 @@ public void Log(Severity sev, string msg)
143158
}
144159
}
145160

146-
message += msg;
161+
message += currMsg;
147162

148163
if (ConsoleEnable)
149164
{
@@ -162,6 +177,11 @@ public void Log(Severity sev, string msg)
162177
else Task.Run(() => SendToSyslog(message));
163178
}
164179
}
180+
181+
if (!String.IsNullOrEmpty(remainder))
182+
{
183+
Log(sev, remainder);
184+
}
165185
}
166186

167187
public void LogException(string module, string method, Exception e)

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.5.0")]
36-
[assembly: AssemblyFileVersion("1.0.5.0")]
35+
[assembly: AssemblyVersion("1.0.6.0")]
36+
[assembly: AssemblyFileVersion("1.0.6.0")]
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.
2 KB
Binary file not shown.
Binary file not shown.

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ 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\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
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
Binary file not shown.

0 commit comments

Comments
 (0)