Commit 183e63c0 authored by Sergei Zubov's avatar Sergei Zubov

Merge branch 'dev' into 'test'

Fix Fody logging and add logs for transaction lifecycle

See merge request !4
parents 1a477a3f ba5de87c
Pipeline #1128 passed with stages
in 15 minutes and 21 seconds
...@@ -357,7 +357,6 @@ Global ...@@ -357,7 +357,6 @@ Global
{FF6DDE2B-CF33-438F-BCC8-B1E109AB2472}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF6DDE2B-CF33-438F-BCC8-B1E109AB2472}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF6DDE2B-CF33-438F-BCC8-B1E109AB2472}.Release|Any CPU.Build.0 = Release|Any CPU {FF6DDE2B-CF33-438F-BCC8-B1E109AB2472}.Release|Any CPU.Build.0 = Release|Any CPU
{6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Release|Any CPU.Build.0 = Release|Any CPU {6A4C72BF-E818-45B1-9DD4-562C7C6F31C8}.Release|Any CPU.Build.0 = Release|Any CPU
{C1D739B1-79CB-4D42-8147-3A31D1B84868}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C1D739B1-79CB-4D42-8147-3A31D1B84868}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
......
...@@ -38,7 +38,7 @@ namespace FodyNlogAdapter.Adapters ...@@ -38,7 +38,7 @@ namespace FodyNlogAdapter.Adapters
} }
[DebuggerStepThrough] [DebuggerStepThrough]
public void TraceEnter(string methodInfo, string[] paramNames, object[] paramValues) public void TraceEnter(string methodInfo, Tuple<string, string>[] methodParameters, string[] paramNames, object[] paramValues)
{ {
if (this.logger.IsTraceEnabled) if (this.logger.IsTraceEnabled)
{ {
...@@ -72,7 +72,7 @@ namespace FodyNlogAdapter.Adapters ...@@ -72,7 +72,7 @@ namespace FodyNlogAdapter.Adapters
} }
[DebuggerStepThrough] [DebuggerStepThrough]
public void TraceLeave(string methodInfo, long startTicks, long endTicks, string[] paramNames, object[] paramValues) public void TraceLeave(string methodInfo, Tuple<string, string>[] methodParameters, long startTicks, long endTicks, string[] paramNames, object[] paramValues)
{ {
if (this.logger.IsTraceEnabled) if (this.logger.IsTraceEnabled)
{ {
......
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Stratis.FodyNlogAdapter</PackageId> <AssemblyName>FodyNlogAdapter</AssemblyName>
<Version>3.0.0.0</Version> <Version>3.0.6.0-beta</Version>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Authors>Stratis Group Ltd.</Authors>
<PackageId>Stratis.FodyNlogAdapter</PackageId>
<Product>Stratis.FodyNlogAdapter</Product>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Weavers> <Weavers GenerateXsd="false">
<Tracer adapterAssembly="FodyNlogAdapter" <Tracer adapterAssembly="FodyNlogAdapter"
logManager="FodyNlogAdapter.Adapters.LogManagerAdapter" logManager="FodyNlogAdapter.Adapters.LogManagerAdapter"
logger="FodyNlogAdapter.Adapters.LoggerAdapter" logger="FodyNlogAdapter.Adapters.LoggerAdapter"
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<TraceOn namespace="Stratis.Bitcoin+*" class="private" method="private" /> <TraceOn namespace="Stratis.Bitcoin+*" class="private" method="private" />
<TraceOn namespace="Stratis.SmartContracts.Core+*" class="private" method="private" /> <TraceOn namespace="Stratis.SmartContracts.Core+*" class="private" method="private" />
<TraceOn namespace="Stratis.SmartContracts.CLR+*" class="private" method="private" /> <TraceOn namespace="Stratis.SmartContracts.CLR+*" class="private" method="private" />
<TraceOn namespace="Stratis.Bitcoin.Features.PoA+*" class="private" method="private" />
<TraceOn namespace="Stratis.Features.FederatedPeg+*" class="private" method="private" />
<TraceOn namespace="Stratis.Bitcoin.Features.SmartContracts+*" class="private" method="private" />
<NoTrace namespace="Stratis.Bitcoin.Features.Consensus+*" /> <NoTrace namespace="Stratis.Bitcoin.Features.Consensus+*" />
<NoTrace namespace="Stratis.Bitcoin.Features.Miner+*" /> <NoTrace namespace="Stratis.Bitcoin.Features.Miner+*" />
<NoTrace namespace="*.Tests+*" /> <NoTrace namespace="*.Tests+*" />
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.5.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="2.5.0" />
<PackageReference Include="System.Reactive" Version="4.0.0" /> <PackageReference Include="System.Reactive" Version="4.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" /> <PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.0.0" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="DNS" Version="2.1.0" /> <PackageReference Include="DNS" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.0.0" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -103,6 +103,8 @@ namespace Stratis.Bitcoin.Features.MemoryPool ...@@ -103,6 +103,8 @@ namespace Stratis.Bitcoin.Features.MemoryPool
this.PerformanceCounter.SetMempoolSize(state.MempoolSize); this.PerformanceCounter.SetMempoolSize(state.MempoolSize);
this.PerformanceCounter.SetMempoolDynamicSize(state.MempoolDynamicSize); this.PerformanceCounter.SetMempoolDynamicSize(state.MempoolDynamicSize);
this.PerformanceCounter.AddHitCount(1); this.PerformanceCounter.AddHitCount(1);
this.logger.LogInformation("Transaction {txId} validated by mempool", tx.GetHash());
}); });
} }
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -382,6 +382,7 @@ namespace Stratis.Bitcoin.Features.MemoryPool ...@@ -382,6 +382,7 @@ namespace Stratis.Bitcoin.Features.MemoryPool
{ {
this.filterInventoryKnown.Add(trxHash); this.filterInventoryKnown.Add(trxHash);
} }
this.logger.LogInformation("Received transaction {txId}. Transaction hex: '{txHex}'", trxHash, trx.ToHex());
this.logger.LogTrace("Added transaction ID '{0}' to known inventory filter.", trxHash); this.logger.LogTrace("Added transaction ID '{0}' to known inventory filter.", trxHash);
var state = new MempoolValidationState(true); var state = new MempoolValidationState(true);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -103,6 +103,9 @@ namespace Stratis.Bitcoin.Features.Miner.Staking ...@@ -103,6 +103,9 @@ namespace Stratis.Bitcoin.Features.Miner.Staking
"Node staking with {0} ({1:0.00} % of the network weight {2}), est. time to find new block is {3}.", "Node staking with {0} ({1:0.00} % of the network weight {2}), est. time to find new block is {3}.",
new Money(ourWeight), ourPercent, new Money(this.networkWeight), TimeSpan.FromSeconds(expectedTime)); new Money(ourWeight), ourPercent, new Money(this.networkWeight), TimeSpan.FromSeconds(expectedTime));
this.logger.LogInformation("Staking block with transactions: {txIds}",
block.Transactions.Select(p => p.GetHash()).ToList());
this.rpcGetStakingInfoModel.ResumeStaking(ourWeight, expectedTime); this.rpcGetStakingInfoModel.ResumeStaking(ourWeight, expectedTime);
long minimalAllowedTime = chainTip.Header.Time + 1; long minimalAllowedTime = chainTip.Header.Time + 1;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" /> <ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" /> <PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" /> <PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" /> <PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" /> <PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Tracer.Fody" Version="2.2.0" /> <PackageReference Include="Tracer.Fody" Version="3.1.0" />
</ItemGroup> </ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Weavers GenerateXsd="false">
</Weavers>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment