Skip to content

Commit

Permalink
>Fix issue #8 "Problems reading settings from log4net.xml"
Browse files Browse the repository at this point in the history
  • Loading branch information
moberacker committed Nov 9, 2018
1 parent 15dda85 commit 4b63e21
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
38 changes: 19 additions & 19 deletions Log4ALA/Log4ALAAppender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ public class Log4ALAAppender : AppenderSkeleton
public string SharedKey { get; set; }
public string LogType { get; set; }
public string AzureApiVersion { get; set; } = ConfigSettings.DEFAULT_AZURE_API_VERSION;
public int? HttpDataCollectorRetry { get; set; } = ConfigSettings.DEFAULT_HTTP_DATA_COLLECTOR_RETRY;
public int HttpDataCollectorRetry { get; set; } = ConfigSettings.DEFAULT_HTTP_DATA_COLLECTOR_RETRY;
public bool LogMessageToFile { get; set; } = ConfigSettings.DEFAULT_LOG_MESSAGE_TOFILE;
public bool DisableInfoLogFile { get; set; } = ConfigSettings.DEFAULT_DISABLE_INFO_APPENDER_FILE;
public bool? AppendLogger { get; set; } = ConfigSettings.DEFAULT_APPEND_LOGGER;
public bool? AppendLogLevel { get; set; } = ConfigSettings.DEFAULT_APPEND_LOGLEVEL;
public bool AppendLogger { get; set; } = ConfigSettings.DEFAULT_APPEND_LOGGER;
public bool AppendLogLevel { get; set; } = ConfigSettings.DEFAULT_APPEND_LOGLEVEL;

public string ErrLoggerName { get; set; }

public string ErrAppenderFile { get; set; }
public string InfoAppenderFile { get; set; }

// Size of the internal event queue.
public int? LoggingQueueSize { get; set; } = ConfigSettings.DEFAULT_LOGGER_QUEUE_SIZE;
public bool? KeyValueDetection { get; set; } = ConfigSettings.DEFAULT_KEY_VALUE_DETECTION;
public bool? JsonDetection { get; set; } = ConfigSettings.DEFAULT_JSON_DETECTION;
public int? BatchSizeInBytes { get; set; } = ConfigSettings.DEFAULT_BATCH_SIZE_BYTES;
public int LoggingQueueSize { get; set; } = ConfigSettings.DEFAULT_LOGGER_QUEUE_SIZE;
public bool KeyValueDetection { get; set; } = ConfigSettings.DEFAULT_KEY_VALUE_DETECTION;
public bool JsonDetection { get; set; } = ConfigSettings.DEFAULT_JSON_DETECTION;
public int BatchSizeInBytes { get; set; } = ConfigSettings.DEFAULT_BATCH_SIZE_BYTES;

public int? BatchNumItems { get; set; } = ConfigSettings.DEFAULT_BATCH_NUM_ITEMS;
public int? BatchWaitInSec { get; set; } = ConfigSettings.DEFAULT_BATCH_WAIT_SECONDS;
public int? BatchWaitMaxInSec { get; set; } = ConfigSettings.DEFAULT_BATCH_WAIT_MAX_SECONDS;
public int? MaxFieldByteLength { get; set; } = ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH;
public int? MaxFieldNameLength { get; set; } = ConfigSettings.DEFAULT_MAX_FIELD_NAME_LENGTH;
public int BatchNumItems { get; set; } = ConfigSettings.DEFAULT_BATCH_NUM_ITEMS;
public int BatchWaitInSec { get; set; } = ConfigSettings.DEFAULT_BATCH_WAIT_SECONDS;
public int BatchWaitMaxInSec { get; set; } = ConfigSettings.DEFAULT_BATCH_WAIT_MAX_SECONDS;
public int MaxFieldByteLength { get; set; } = ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH;
public int MaxFieldNameLength { get; set; } = ConfigSettings.DEFAULT_MAX_FIELD_NAME_LENGTH;

public string KeyValueSeparator { get; set; } = ConfigSettings.DEFAULT_KEY_VALUE_SEPARATOR;
public string KeyValuePairSeparator { get; set; } = ConfigSettings.DEFAULT_KEY_VALUE_PAIR_SEPARATOR;
Expand Down Expand Up @@ -240,29 +240,29 @@ public override void ActivateOptions()
}
log.Inf($"[{this.Name}] - threadPriority:[{ThreadPriority}]", true);

HttpDataCollectorRetry = configSettings.ALAHttpDataCollectorRetry == null ? HttpDataCollectorRetry : configSettings.ALAHttpDataCollectorRetry;
HttpDataCollectorRetry = configSettings.ALAHttpDataCollectorRetry == null ? HttpDataCollectorRetry : (int)configSettings.ALAHttpDataCollectorRetry;
log.Inf($"[{this.Name}] - httpDataCollectorRetry:[{HttpDataCollectorRetry}]", true);

BatchSizeInBytes = configSettings.ALABatchSizeInBytes == null ? BatchSizeInBytes : configSettings.ALABatchSizeInBytes;
BatchSizeInBytes = configSettings.ALABatchSizeInBytes == null ? BatchSizeInBytes : (int)configSettings.ALABatchSizeInBytes;
log.Inf($"[{this.Name}] - batchSizeInBytes:[{BatchSizeInBytes}]", true);

BatchNumItems = configSettings.ALABatchNumItems == null ? BatchNumItems : configSettings.ALABatchNumItems;
BatchNumItems = configSettings.ALABatchNumItems == null ? BatchNumItems : (int)configSettings.ALABatchNumItems;

BatchWaitInSec = configSettings.ALABatchWaitInSec == null ? BatchWaitInSec : configSettings.ALABatchWaitInSec;
BatchWaitInSec = configSettings.ALABatchWaitInSec == null ? BatchWaitInSec : (int)configSettings.ALABatchWaitInSec;
log.Inf($"[{this.Name}] - batchWaitInSec:[{BatchWaitInSec}]", true);

BatchWaitMaxInSec = configSettings.ALABatchWaitMaxInSec == null ? BatchWaitMaxInSec : configSettings.ALABatchWaitMaxInSec;
BatchWaitMaxInSec = configSettings.ALABatchWaitMaxInSec == null ? BatchWaitMaxInSec : (int)configSettings.ALABatchWaitMaxInSec;
log.Inf($"[{this.Name}] - batchWaitMaxInSec:[{BatchWaitMaxInSec}]", true);

MaxFieldByteLength = configSettings.ALAMaxFieldByteLength == null ? MaxFieldByteLength : configSettings.ALAMaxFieldByteLength;
MaxFieldByteLength = configSettings.ALAMaxFieldByteLength == null ? MaxFieldByteLength : (int)configSettings.ALAMaxFieldByteLength;
if(MaxFieldByteLength > ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH)
{
MaxFieldByteLength = ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH;
}
log.Inf($"[{this.Name}] - maxFieldByteLength:[{MaxFieldByteLength}]", true);


MaxFieldNameLength = configSettings.ALAMaxFieldNameLength == null ? MaxFieldNameLength : configSettings.ALAMaxFieldNameLength;
MaxFieldNameLength = configSettings.ALAMaxFieldNameLength == null ? MaxFieldNameLength : (int)configSettings.ALAMaxFieldNameLength;
if (MaxFieldNameLength > ConfigSettings.DEFAULT_MAX_FIELD_NAME_LENGTH)
{
MaxFieldNameLength = ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH;
Expand Down
4 changes: 2 additions & 2 deletions Log4ALA/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.5")]
[assembly: AssemblyFileVersion("2.3.5")]
[assembly: AssemblyVersion("2.3.6")]
[assembly: AssemblyFileVersion("2.3.6")]
2 changes: 1 addition & 1 deletion Log4ALATest.Core/Log4ALATest.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


<ItemGroup>
<PackageReference Include="Log4ALA" Version="2.3.5" />
<PackageReference Include="Log4ALA" Version="2.3.6" />
</ItemGroup>


Expand Down
4 changes: 2 additions & 2 deletions Log4ALATest/Log4ALATest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Log4ALA, Version=2.3.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Log4ALA.2.3.5\lib\net45\Log4ALA.dll</HintPath>
<Reference Include="Log4ALA, Version=2.3.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Log4ALA.2.3.6\lib\net45\Log4ALA.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion Log4ALATest/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Log4ALA" version="2.3.5" targetFramework="net452" />
<package id="Log4ALA" version="2.3.6" targetFramework="net452" />
<package id="log4net" version="2.0.5" targetFramework="net452" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
Expand Down
4 changes: 2 additions & 2 deletions NuGet/Log4ALA.Core/Log4ALA.core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<metadata minClientVersion="3.3.0">
<id>Log4ALA.Core</id>
<title>Log4ALA</title>
<version>2.3.5</version>
<version>2.3.6</version>
<authors>mob</authors>
<owners>mob</owners>
<projectUrl>https://ptv-logistics.github.io/Log4ALA/</projectUrl>
<licenseUrl>https://github.com/ptv-logistics/Log4ALA/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Log4Net appender for Azure Log Analytics (ALA)... sending data to Azure Log Analytics with the HTTP Data Collector API. The data will also be logged/sent asynchronously for high performance and to avoid blocking the caller thread.</description>
<copyright>Copyright © 2018 PTV Group</copyright>
<releaseNotes>Fix to remove all leading and trailing white-space characters from custom field names to avoid e.g custom field names with e.g. leading underscores.</releaseNotes>
<releaseNotes>Fix issue #8 "Problems reading settings from log4net.xml".</releaseNotes>
<dependencies>
<group targetFramework=".netstandard2.0">
<dependency id="log4net" version="2.0.8" />
Expand Down
4 changes: 2 additions & 2 deletions NuGet/Log4ALA/Log4ALA.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<metadata minClientVersion="3.3.0">
<id>Log4ALA</id>
<title>Log4ALA</title>
<version>2.3.5</version>
<version>2.3.6</version>
<authors>mob</authors>
<owners>mob</owners>
<projectUrl>https://ptv-logistics.github.io/Log4ALA/</projectUrl>
<licenseUrl>https://github.com/ptv-logistics/Log4ALA/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Log4Net appender for Azure Log Analytics (ALA)... sending data to Azure Log Analytics with the HTTP Data Collector API. The data will also be logged/sent asynchronously for high performance and to avoid blocking the caller thread.</description>
<copyright>Copyright © 2018 PTV Group</copyright>
<releaseNotes>Fix to remove all leading and trailing white-space characters from custom field names to avoid e.g custom field names with e.g. leading underscores.</releaseNotes>
<releaseNotes>Fix issue #8 "Problems reading settings from log4net.xml".</releaseNotes>
<dependencies>
<group targetFramework="net45">
<dependency id="log4net" version="2.0.5" />
Expand Down
2 changes: 1 addition & 1 deletion NuGet/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ REM %MSBUILD% build.proj /target:NuGetRestore
REM %MSBUILD% /p:Configuration=Release ..\Log4ALA.sln
REM %MSBUILD% build.proj /target:NuGetPack /property:Configuration=Release;RELEASE=true
REM PackageVersion=4.5.0;PatchVersion=0;PatchCoreVersion=0
%MSBUILD% build.proj /target:BuildAll /property:Configuration=Release;RELEASE=true;MajorVersion=2;MinorVersion=3;PatchVersion=5
%MSBUILD% build.proj /target:BuildAll /property:Configuration=Release;RELEASE=true;MajorVersion=2;MinorVersion=3;PatchVersion=6
pause
2 changes: 1 addition & 1 deletion NuGet/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<MajorVersion Condition="$(MajorVersion) == ''">2</MajorVersion>
<MinorVersion Condition="$(MinorVersion) == ''">3</MinorVersion>
<PatchVersion Condition="$(PatchVersion) == ''">5</PatchVersion>
<PatchVersion Condition="$(PatchVersion) == ''">6</PatchVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 4b63e21

Please sign in to comment.