Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
10b85e67
Unverified
Commit
10b85e67
authored
Feb 05, 2019
by
Lemon
Committed by
GitHub
Feb 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Asp.Net Core package version conflicts (#137)
parent
ccad0cf3
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
64 additions
and
48 deletions
+64
-48
SkyWalking.Sample.Backend.csproj
...kyWalking.Sample.Backend/SkyWalking.Sample.Backend.csproj
+3
-0
InstrumentationConfig.cs
src/SkyWalking.Abstractions/Config/InstrumentationConfig.cs
+3
-0
SkyWalking.Agent.AspNetCore.csproj
...lking.Agent.AspNetCore/SkyWalking.Agent.AspNetCore.csproj
+1
-2
HostingDiagnosticProcessor.cs
...king.Diagnostics.AspNetCore/HostingDiagnosticProcessor.cs
+18
-10
SkyWalking.Diagnostics.AspNetCore.csproj
...stics.AspNetCore/SkyWalking.Diagnostics.AspNetCore.csproj
+2
-2
SkyWalking.Diagnostics.CAP.csproj
...Walking.Diagnostics.CAP/SkyWalking.Diagnostics.CAP.csproj
+1
-1
NpgsqlEFCoreSpanMetadataProvider.cs
...yFrameworkCore.Npgsql/NpgsqlEFCoreSpanMetadataProvider.cs
+2
-2
SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj
.../SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj
+1
-1
MySqlEFCoreSpanMetadataProvider.cs
...eworkCore.Pomelo.MySql/MySqlEFCoreSpanMetadataProvider.cs
+1
-1
SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj
...lking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj
+1
-1
SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj
.../SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj
+1
-1
SqliteEFCoreSpanMetadataProvider.cs
...yFrameworkCore.Sqlite/SqliteEFCoreSpanMetadataProvider.cs
+8
-8
SkyWalking.Diagnostics.EntityFrameworkCore.csproj
...orkCore/SkyWalking.Diagnostics.EntityFrameworkCore.csproj
+2
-2
SkyWalking.Diagnostics.MySqlData.csproj
...nostics.MySqlData/SkyWalking.Diagnostics.MySqlData.csproj
+1
-1
SkyWalking.Diagnostics.SqlClient.csproj
...nostics.SqlClient/SkyWalking.Diagnostics.SqlClient.csproj
+1
-1
SkyWalking.Utilities.Configuration.csproj
...s.Configuration/SkyWalking.Utilities.Configuration.csproj
+4
-4
SkyWalking.Utilities.DependencyInjection.csproj
...Injection/SkyWalking.Utilities.DependencyInjection.csproj
+1
-1
DefaultLoggerFactory.cs
src/SkyWalking.Utilities.Logging/DefaultLoggerFactory.cs
+12
-9
SkyWalking.Utilities.Logging.csproj
...ing.Utilities.Logging/SkyWalking.Utilities.Logging.csproj
+1
-1
No files found.
sample/SkyWalking.Sample.Backend/SkyWalking.Sample.Backend.csproj
View file @
10b85e67
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite">
<Version>2.1.0</Version>
</PackageReference>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Content Update="appsettings.json">
<Content Update="appsettings.json">
...
...
src/SkyWalking.Abstractions/Config/InstrumentationConfig.cs
View file @
10b85e67
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
*
*
*/
*/
using
System
;
namespace
SkyWalking.Config
namespace
SkyWalking.Config
{
{
[
Config
(
"SkyWalking"
)]
[
Config
(
"SkyWalking"
)]
...
@@ -23,6 +25,7 @@ namespace SkyWalking.Config
...
@@ -23,6 +25,7 @@ namespace SkyWalking.Config
{
{
public
string
Namespace
{
get
;
set
;
}
public
string
Namespace
{
get
;
set
;
}
[
Obsolete
(
"Use ServiceName."
)]
public
string
ApplicationCode
{
get
;
set
;
}
public
string
ApplicationCode
{
get
;
set
;
}
public
string
ServiceName
{
get
;
set
;
}
public
string
ServiceName
{
get
;
set
;
}
...
...
src/SkyWalking.Agent.AspNetCore/SkyWalking.Agent.AspNetCore.csproj
View file @
10b85e67
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
...
...
src/SkyWalking.Diagnostics.AspNetCore/HostingDiagnosticProcessor.cs
View file @
10b85e67
...
@@ -36,7 +36,8 @@ namespace SkyWalking.AspNetCore.Diagnostics
...
@@ -36,7 +36,8 @@ namespace SkyWalking.AspNetCore.Diagnostics
private
readonly
InstrumentationConfig
_config
;
private
readonly
InstrumentationConfig
_config
;
private
readonly
IContextCarrierFactory
_contextCarrierFactory
;
private
readonly
IContextCarrierFactory
_contextCarrierFactory
;
public
HostingTracingDiagnosticProcessor
(
IConfigAccessor
configAccessor
,
IContextCarrierFactory
contextCarrierFactory
)
public
HostingTracingDiagnosticProcessor
(
IConfigAccessor
configAccessor
,
IContextCarrierFactory
contextCarrierFactory
)
{
{
_config
=
configAccessor
.
Get
<
InstrumentationConfig
>();
_config
=
configAccessor
.
Get
<
InstrumentationConfig
>();
_contextCarrierFactory
=
contextCarrierFactory
;
_contextCarrierFactory
=
contextCarrierFactory
;
...
@@ -48,7 +49,7 @@ namespace SkyWalking.AspNetCore.Diagnostics
...
@@ -48,7 +49,7 @@ namespace SkyWalking.AspNetCore.Diagnostics
var
carrier
=
_contextCarrierFactory
.
Create
();
var
carrier
=
_contextCarrierFactory
.
Create
();
foreach
(
var
item
in
carrier
.
Items
)
foreach
(
var
item
in
carrier
.
Items
)
item
.
HeadValue
=
httpContext
.
Request
.
Headers
[
item
.
HeadKey
];
item
.
HeadValue
=
httpContext
.
Request
.
Headers
[
item
.
HeadKey
];
var
httpRequestSpan
=
ContextManager
.
CreateEntrySpan
(
$"
{
_config
.
ApplicationCode
}
{
httpContext
.
Request
.
Path
}
"
,
carrier
);
var
httpRequestSpan
=
ContextManager
.
CreateEntrySpan
(
httpContext
.
Request
.
Path
,
carrier
);
httpRequestSpan
.
AsHttp
();
httpRequestSpan
.
AsHttp
();
httpRequestSpan
.
SetComponent
(
ComponentsDefine
.
AspNetCore
);
httpRequestSpan
.
SetComponent
(
ComponentsDefine
.
AspNetCore
);
Tags
.
Url
.
Set
(
httpRequestSpan
,
httpContext
.
Request
.
Path
);
Tags
.
Url
.
Set
(
httpRequestSpan
,
httpContext
.
Request
.
Path
);
...
@@ -57,7 +58,10 @@ namespace SkyWalking.AspNetCore.Diagnostics
...
@@ -57,7 +58,10 @@ namespace SkyWalking.AspNetCore.Diagnostics
new
Dictionary
<
string
,
object
>
new
Dictionary
<
string
,
object
>
{
{
{
"event"
,
"AspNetCore Hosting BeginRequest"
},
{
"event"
,
"AspNetCore Hosting BeginRequest"
},
{
"message"
,
$"Request starting
{
httpContext
.
Request
.
Protocol
}
{
httpContext
.
Request
.
Method
}
{
httpContext
.
Request
.
GetDisplayUrl
()}
"
}
{
"message"
,
$"Request starting
{
httpContext
.
Request
.
Protocol
}
{
httpContext
.
Request
.
Method
}
{
httpContext
.
Request
.
GetDisplayUrl
()}
"
}
});
});
httpContext
.
Items
[
HttpContextDiagnosticStrings
.
SpanKey
]
=
httpRequestSpan
;
httpContext
.
Items
[
HttpContextDiagnosticStrings
.
SpanKey
]
=
httpRequestSpan
;
}
}
...
@@ -82,25 +86,28 @@ namespace SkyWalking.AspNetCore.Diagnostics
...
@@ -82,25 +86,28 @@ namespace SkyWalking.AspNetCore.Diagnostics
new
Dictionary
<
string
,
object
>
new
Dictionary
<
string
,
object
>
{
{
{
"event"
,
"AspNetCore Hosting EndRequest"
},
{
"event"
,
"AspNetCore Hosting EndRequest"
},
{
"message"
,
$"Request finished
{
httpContext
.
Response
.
StatusCode
}
{
httpContext
.
Response
.
ContentType
}
"
}
{
"message"
,
$"Request finished
{
httpContext
.
Response
.
StatusCode
}
{
httpContext
.
Response
.
ContentType
}
"
}
});
});
ContextManager
.
StopSpan
(
httpRequestSpan
);
ContextManager
.
StopSpan
(
httpRequestSpan
);
}
}
[
DiagnosticName
(
"Microsoft.AspNetCore.Diagnostics.UnhandledException"
)]
[
DiagnosticName
(
"Microsoft.AspNetCore.Diagnostics.UnhandledException"
)]
public
void
DiagnosticUnhandledException
([
Property
]
HttpContext
httpContext
,
[
Property
]
Exception
exception
)
public
void
DiagnosticUnhandledException
([
Property
]
HttpContext
httpContext
,
[
Property
]
Exception
exception
)
{
{
ContextManager
.
ActiveSpan
?.
ErrorOccurred
()?.
Log
(
exception
);
ContextManager
.
ActiveSpan
?.
ErrorOccurred
()?.
Log
(
exception
);
}
}
[
DiagnosticName
(
"Microsoft.AspNetCore.Hosting.UnhandledException"
)]
[
DiagnosticName
(
"Microsoft.AspNetCore.Hosting.UnhandledException"
)]
public
void
HostingUnhandledException
([
Property
]
HttpContext
httpContext
,
[
Property
]
Exception
exception
)
public
void
HostingUnhandledException
([
Property
]
HttpContext
httpContext
,
[
Property
]
Exception
exception
)
{
{
ContextManager
.
ActiveSpan
?.
ErrorOccurred
()?.
Log
(
exception
);
ContextManager
.
ActiveSpan
?.
ErrorOccurred
()?.
Log
(
exception
);
}
}
//[DiagnosticName("Microsoft.AspNetCore.Mvc.BeforeAction")]
//[DiagnosticName("Microsoft.AspNetCore.Mvc.BeforeAction")]
public
void
BeforeAction
([
Property
]
ActionDescriptor
actionDescriptor
,
[
Property
]
HttpContext
httpContext
)
public
void
BeforeAction
([
Property
]
ActionDescriptor
actionDescriptor
,
[
Property
]
HttpContext
httpContext
)
{
{
var
span
=
httpContext
.
Items
[
HttpContextDiagnosticStrings
.
SpanKey
]
as
ISpan
;
var
span
=
httpContext
.
Items
[
HttpContextDiagnosticStrings
.
SpanKey
]
as
ISpan
;
if
(
span
==
null
)
if
(
span
==
null
)
...
@@ -108,12 +115,13 @@ namespace SkyWalking.AspNetCore.Diagnostics
...
@@ -108,12 +115,13 @@ namespace SkyWalking.AspNetCore.Diagnostics
return
;
return
;
}
}
var
events
=
new
Dictionary
<
string
,
object
>
{{
"event"
,
"AspNetCore.Mvc Executing action method"
},
{
"Action method"
,
actionDescriptor
.
DisplayName
}};
var
events
=
new
Dictionary
<
string
,
object
>
{{
"event"
,
"AspNetCore.Mvc Executing action method"
},
{
"Action method"
,
actionDescriptor
.
DisplayName
}};
span
.
Log
(
DateTimeOffset
.
UtcNow
.
ToUnixTimeMilliseconds
(),
events
);
span
.
Log
(
DateTimeOffset
.
UtcNow
.
ToUnixTimeMilliseconds
(),
events
);
}
}
//[DiagnosticName("Microsoft.AspNetCore.Mvc.AfterAction")]
//[DiagnosticName("Microsoft.AspNetCore.Mvc.AfterAction")]
public
void
AfterAction
([
Property
]
ActionDescriptor
actionDescriptor
,
[
Property
]
HttpContext
httpContext
)
public
void
AfterAction
([
Property
]
ActionDescriptor
actionDescriptor
,
[
Property
]
HttpContext
httpContext
)
{
{
var
span
=
httpContext
.
Items
[
HttpContextDiagnosticStrings
.
SpanKey
]
as
ISpan
;
var
span
=
httpContext
.
Items
[
HttpContextDiagnosticStrings
.
SpanKey
]
as
ISpan
;
if
(
span
==
null
)
if
(
span
==
null
)
...
...
src/SkyWalking.Diagnostics.AspNetCore/SkyWalking.Diagnostics.AspNetCore.csproj
View file @
10b85e67
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.
2.0
" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.
0.0" PrivateAssets="All
" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.
2.0
" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.
0.0" PrivateAssets="All
" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/SkyWalking.Diagnostics.CAP/SkyWalking.Diagnostics.CAP.csproj
View file @
10b85e67
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="2.3.1" />
<PackageReference Include="DotNetCore.CAP" Version="2.3.1"
PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
src/SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql/NpgsqlEFCoreSpanMetadataProvider.cs
View file @
10b85e67
...
@@ -25,10 +25,10 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
...
@@ -25,10 +25,10 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
public
class
NpgsqlEFCoreSpanMetadataProvider
:
IEfCoreSpanMetadataProvider
public
class
NpgsqlEFCoreSpanMetadataProvider
:
IEfCoreSpanMetadataProvider
{
{
public
IComponent
Component
{
get
;
}
=
ComponentsDefine
.
Npgsql_EntityFrameworkCore_PostgreSQL
;
public
IComponent
Component
{
get
;
}
=
ComponentsDefine
.
Npgsql_EntityFrameworkCore_PostgreSQL
;
public
bool
Match
(
DbConnection
connection
)
public
bool
Match
(
DbConnection
connection
)
{
{
return
connection
is
NpgsqlConnection
;
return
connection
.
GetType
().
FullName
==
"Npgsql.NpgsqlConnection"
;
}
}
public
string
GetPeer
(
DbConnection
connection
)
public
string
GetPeer
(
DbConnection
connection
)
...
...
src/SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql/SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj
View file @
10b85e67
...
@@ -18,6 +18,6 @@
...
@@ -18,6 +18,6 @@
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.
1.2"
/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.
0.0" PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql/MySqlEFCoreSpanMetadataProvider.cs
View file @
10b85e67
...
@@ -28,7 +28,7 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
...
@@ -28,7 +28,7 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
public
bool
Match
(
DbConnection
connection
)
public
bool
Match
(
DbConnection
connection
)
{
{
return
connection
is
MySqlConnection
;
return
connection
.
GetType
().
FullName
==
"MySql.Data.MySqlClient.MySqlConnection"
;
}
}
public
string
GetPeer
(
DbConnection
connection
)
public
string
GetPeer
(
DbConnection
connection
)
...
...
src/SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql/SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj
View file @
10b85e67
...
@@ -18,6 +18,6 @@
...
@@ -18,6 +18,6 @@
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.4" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.4"
PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite/SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj
View file @
10b85e67
...
@@ -18,6 +18,6 @@
...
@@ -18,6 +18,6 @@
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.
2.0"
/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.
0.0" PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite/SqliteEFCoreSpanMetadataProvider.cs
View file @
10b85e67
...
@@ -25,10 +25,10 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
...
@@ -25,10 +25,10 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
public
class
SqliteEFCoreSpanMetadataProvider
:
IEfCoreSpanMetadataProvider
public
class
SqliteEFCoreSpanMetadataProvider
:
IEfCoreSpanMetadataProvider
{
{
public
IComponent
Component
{
get
;
}
=
ComponentsDefine
.
EntityFrameworkCore_Sqlite
;
public
IComponent
Component
{
get
;
}
=
ComponentsDefine
.
EntityFrameworkCore_Sqlite
;
public
bool
Match
(
DbConnection
connection
)
public
bool
Match
(
DbConnection
connection
)
{
{
return
connection
is
SqliteConnection
;
return
connection
.
GetType
().
FullName
==
"Microsoft.Data.Sqlite.SqliteConnection"
;
}
}
public
string
GetPeer
(
DbConnection
connection
)
public
string
GetPeer
(
DbConnection
connection
)
...
@@ -36,12 +36,12 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
...
@@ -36,12 +36,12 @@ namespace SkyWalking.Diagnostics.EntityFrameworkCore
string
dataSource
;
string
dataSource
;
switch
(
connection
.
DataSource
)
switch
(
connection
.
DataSource
)
{
{
case
""
:
case
""
:
dataSource
=
"sqlite:memory:db"
;
dataSource
=
"sqlite:memory:db"
;
break
;
break
;
default
:
default
:
dataSource
=
connection
.
DataSource
;
dataSource
=
connection
.
DataSource
;
break
;
break
;
}
}
return
$"
{
dataSource
}
"
;
return
$"
{
dataSource
}
"
;
...
...
src/SkyWalking.Diagnostics.EntityFrameworkCore/SkyWalking.Diagnostics.EntityFrameworkCore.csproj
View file @
10b85e67
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
<RootNamespace>SkyWalking.Diagnostics.EntityFrameworkCore</RootNamespace>
<RootNamespace>SkyWalking.Diagnostics.EntityFrameworkCore</RootNamespace>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.
2.0"
/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.
0.0" PrivateAssets="All"
/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.
2.0"
/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.
0.0" PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
...
...
src/SkyWalking.Diagnostics.MySqlData/SkyWalking.Diagnostics.MySqlData.csproj
View file @
10b85e67
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="MySql.Data" Version="6.10.7" />
<PackageReference Include="MySql.Data" Version="6.10.7"
PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
src/SkyWalking.Diagnostics.SqlClient/SkyWalking.Diagnostics.SqlClient.csproj
View file @
10b85e67
...
@@ -17,6 +17,6 @@
...
@@ -17,6 +17,6 @@
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0"
PrivateAssets="All"
/>
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/SkyWalking.Utilities.Configuration/SkyWalking.Utilities.Configuration.csproj
View file @
10b85e67
...
@@ -17,9 +17,9 @@
...
@@ -17,9 +17,9 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.
2
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.
0
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.
2
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.
0
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.
2
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.
0
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.
2
.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.
0
.0" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
src/SkyWalking.Utilities.DependencyInjection/SkyWalking.Utilities.DependencyInjection.csproj
View file @
10b85e67
...
@@ -15,6 +15,6 @@
...
@@ -15,6 +15,6 @@
<ProjectReference Include="..\SkyWalking.Core\SkyWalking.Core.csproj" />
<ProjectReference Include="..\SkyWalking.Core\SkyWalking.Core.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.
2
.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.
0
.0" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
src/SkyWalking.Utilities.Logging/DefaultLoggerFactory.cs
View file @
10b85e67
...
@@ -29,7 +29,9 @@ namespace SkyWalking.Utilities.Logging
...
@@ -29,7 +29,9 @@ namespace SkyWalking.Utilities.Logging
{
{
public
class
DefaultLoggerFactory
:
ILoggerFactory
public
class
DefaultLoggerFactory
:
ILoggerFactory
{
{
private
const
string
outputTemplate
=
@"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ApplicationCode}] [{Level}] {SourceContext} : {Message}{NewLine}{Exception}"
;
private
const
string
outputTemplate
=
@"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{ApplicationCode}] [{Level}] {SourceContext} : {Message}{NewLine}{Exception}"
;
private
readonly
MSLoggerFactory
_loggerFactory
;
private
readonly
MSLoggerFactory
_loggerFactory
;
private
readonly
LoggingConfig
_loggingConfig
;
private
readonly
LoggingConfig
_loggingConfig
;
...
@@ -41,13 +43,12 @@ namespace SkyWalking.Utilities.Logging
...
@@ -41,13 +43,12 @@ namespace SkyWalking.Utilities.Logging
var
level
=
EventLevel
(
_loggingConfig
.
Level
);
var
level
=
EventLevel
(
_loggingConfig
.
Level
);
_loggerFactory
.
AddSerilog
(
new
LoggerConfiguration
().
_loggerFactory
.
AddSerilog
(
new
LoggerConfiguration
().
MinimumLevel
.
Verbose
().
Enrich
MinimumLevel
.
Verbose
().
.
WithProperty
(
"SourceContext"
,
null
).
Enrich
Enrich
.
WithProperty
(
"SourceContext"
,
null
).
.
WithProperty
(
nameof
(
instrumentationConfig
.
ServiceName
),
Enrich
.
WithProperty
(
nameof
(
instrumentationConfig
.
ApplicationCode
),
instrumentationConfig
.
ApplicationCode
).
instrumentationConfig
.
ServiceName
??
instrumentationConfig
.
ApplicationCode
).
Enrich
Enrich
.
FromLogContext
().
.
FromLogContext
().
WriteTo
.
RollingFile
(
_loggingConfig
.
FilePath
,
level
,
outputTemplate
,
null
,
1073741824
,
WriteTo
.
RollingFile
(
_loggingConfig
.
FilePath
,
level
,
outputTemplate
,
null
,
1073741824
,
31
,
null
,
false
,
false
,
TimeSpan
.
FromMilliseconds
(
500
)).
31
,
null
,
false
,
false
,
TimeSpan
.
FromMilliseconds
(
500
)).
CreateLogger
());
CreateLogger
());
}
}
public
ILogger
CreateLogger
(
Type
type
)
public
ILogger
CreateLogger
(
Type
type
)
...
@@ -57,7 +58,9 @@ namespace SkyWalking.Utilities.Logging
...
@@ -57,7 +58,9 @@ namespace SkyWalking.Utilities.Logging
private
static
LogEventLevel
EventLevel
(
string
level
)
private
static
LogEventLevel
EventLevel
(
string
level
)
{
{
return
LogEventLevel
.
TryParse
<
LogEventLevel
>(
level
,
out
var
logEventLevel
)
?
logEventLevel
:
LogEventLevel
.
Error
;
return
LogEventLevel
.
TryParse
<
LogEventLevel
>(
level
,
out
var
logEventLevel
)
?
logEventLevel
:
LogEventLevel
.
Error
;
}
}
}
}
}
}
\ No newline at end of file
src/SkyWalking.Utilities.Logging/SkyWalking.Utilities.Logging.csproj
View file @
10b85e67
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.
2
.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.
0
.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
</ItemGroup>
</ItemGroup>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment