@@ -46,7 +46,7 @@ public ServerSession(ConnectionPool? pool, int poolGeneration, int id)
46
46
PoolGeneration = poolGeneration ;
47
47
HostName = "" ;
48
48
m_logArguments = new object ? [ ] { "{0}" . FormatInvariant ( Id ) , null } ;
49
- Log . Debug ( "Session{0} created new session" , m_logArguments ) ;
49
+ Log . Trace ( "Session{0} created new session" , m_logArguments ) ;
50
50
}
51
51
52
52
public string Id { get ; }
@@ -74,10 +74,10 @@ public ValueTask<int> ReturnToPoolAsync(IOBehavior ioBehavior, MySqlConnection?
74
74
public ValueTask ReturnToPoolAsync ( IOBehavior ioBehavior , MySqlConnection ? owningConnection )
75
75
#endif
76
76
{
77
- if ( Log . IsDebugEnabled ( ) )
77
+ if ( Log . IsTraceEnabled ( ) )
78
78
{
79
79
m_logArguments [ 1 ] = Pool ? . Id ;
80
- Log . Debug ( "Session{0} returning to Pool{1}" , m_logArguments ) ;
80
+ Log . Trace ( "Session{0} returning to Pool{1}" , m_logArguments ) ;
81
81
}
82
82
LastReturnedTicks = unchecked ( ( uint ) Environment . TickCount ) ;
83
83
if ( Pool is null )
@@ -296,7 +296,7 @@ public void StartQuerying(ICancellableCommand command)
296
296
public void FinishQuerying ( )
297
297
{
298
298
m_logArguments [ 1 ] = m_state ;
299
- Log . Debug ( "Session{0} entering FinishQuerying; SessionState={1}" , m_logArguments ) ;
299
+ Log . Trace ( "Session{0} entering FinishQuerying; SessionState={1}" , m_logArguments ) ;
300
300
bool clearConnection = false ;
301
301
lock ( m_lock )
302
302
{
@@ -432,7 +432,7 @@ public async Task DisposeAsync(IOBehavior ioBehavior, CancellationToken cancella
432
432
else
433
433
authPluginName = ( initialHandshake . ProtocolCapabilities & ProtocolCapabilities . SecureConnection ) == 0 ? "mysql_old_password" : "mysql_native_password" ;
434
434
m_logArguments [ 1 ] = authPluginName ;
435
- Log . Debug ( "Session{0} server sent AuthPluginName={1}" , m_logArguments ) ;
435
+ Log . Trace ( "Session{0} server sent AuthPluginName={1}" , m_logArguments ) ;
436
436
if ( authPluginName != "mysql_native_password" && authPluginName != "sha256_password" && authPluginName != "caching_sha2_password" )
437
437
{
438
438
Log . Error ( "Session{0} unsupported authentication method AuthPluginName={1}" , m_logArguments ) ;
@@ -547,7 +547,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
547
547
if ( DatabaseOverride is null && ( ServerVersion . Version . CompareTo ( ServerVersions . SupportsResetConnection ) >= 0 || ServerVersion . MariaDbVersion ? . CompareTo ( ServerVersions . MariaDbSupportsResetConnection ) >= 0 ) )
548
548
{
549
549
m_logArguments [ 1 ] = ServerVersion . OriginalString ;
550
- Log . Debug ( "Session{0} ServerVersion={1} supports reset connection; sending reset connection request" , m_logArguments ) ;
550
+ Log . Trace ( "Session{0} ServerVersion={1} supports reset connection; sending reset connection request" , m_logArguments ) ;
551
551
await SendAsync ( ResetConnectionPayload . Instance , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
552
552
payload = await ReceiveReplyAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
553
553
OkPayload . Create ( payload . Span , SupportsDeprecateEof , SupportsSessionTrack ) ;
@@ -558,7 +558,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
558
558
if ( DatabaseOverride is null )
559
559
{
560
560
m_logArguments [ 1 ] = ServerVersion . OriginalString ;
561
- Log . Debug ( "Session{0} ServerVersion={1} doesn't support reset connection; sending change user request" , m_logArguments ) ;
561
+ Log . Trace ( "Session{0} ServerVersion={1} doesn't support reset connection; sending change user request" , m_logArguments ) ;
562
562
}
563
563
else
564
564
{
@@ -572,7 +572,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
572
572
payload = await ReceiveReplyAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
573
573
if ( payload . HeaderByte == AuthenticationMethodSwitchRequestPayload . Signature )
574
574
{
575
- Log . Debug ( "Session{0} optimistic reauthentication failed; logging in again" , m_logArguments ) ;
575
+ Log . Trace ( "Session{0} optimistic reauthentication failed; logging in again" , m_logArguments ) ;
576
576
payload = await SwitchAuthenticationAsync ( cs , payload , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
577
577
}
578
578
OkPayload . Create ( payload . Span , SupportsDeprecateEof , SupportsSessionTrack ) ;
@@ -587,19 +587,19 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
587
587
}
588
588
catch ( IOException ex )
589
589
{
590
- Log . Debug ( ex , "Session{0} ignoring IOException in TryResetConnectionAsync" , m_logArguments ) ;
590
+ Log . Trace ( ex , "Session{0} ignoring IOException in TryResetConnectionAsync" , m_logArguments ) ;
591
591
}
592
592
catch ( MySqlException ex ) when ( ex . ErrorCode == MySqlErrorCode . ClientInteractionTimeout )
593
593
{
594
- Log . Debug ( ex , "Session{0} ignoring ClientInteractionTimeout MySqlException in TryResetConnectionAsync" , m_logArguments ) ;
594
+ Log . Trace ( ex , "Session{0} ignoring ClientInteractionTimeout MySqlException in TryResetConnectionAsync" , m_logArguments ) ;
595
595
}
596
596
catch ( ObjectDisposedException ex )
597
597
{
598
- Log . Debug ( ex , "Session{0} ignoring ObjectDisposedException in TryResetConnectionAsync" , m_logArguments ) ;
598
+ Log . Trace ( ex , "Session{0} ignoring ObjectDisposedException in TryResetConnectionAsync" , m_logArguments ) ;
599
599
}
600
600
catch ( SocketException ex )
601
601
{
602
- Log . Debug ( ex , "Session{0} ignoring SocketException in TryResetConnectionAsync" , m_logArguments ) ;
602
+ Log . Trace ( ex , "Session{0} ignoring SocketException in TryResetConnectionAsync" , m_logArguments ) ;
603
603
}
604
604
605
605
if ( returnToPool && Pool is not null )
@@ -618,7 +618,7 @@ private async Task<PayloadData> SwitchAuthenticationAsync(ConnectionSettings cs,
618
618
// if the server didn't support the hashed password; rehash with the new challenge
619
619
var switchRequest = AuthenticationMethodSwitchRequestPayload . Create ( payload . Span ) ;
620
620
m_logArguments [ 1 ] = switchRequest . Name ;
621
- Log . Debug ( "Session{0} switching to AuthenticationMethod '{1}'" , m_logArguments ) ;
621
+ Log . Trace ( "Session{0} switching to AuthenticationMethod '{1}'" , m_logArguments ) ;
622
622
switch ( switchRequest . Name )
623
623
{
624
624
case "mysql_native_password" :
@@ -798,27 +798,27 @@ public async ValueTask<bool> TryPingAsync(bool logInfo, IOBehavior ioBehavior, C
798
798
// send ping payload to verify client and server socket are still connected
799
799
try
800
800
{
801
- Log . Debug ( "Session{0} pinging server" , m_logArguments ) ;
801
+ Log . Trace ( "Session{0} pinging server" , m_logArguments ) ;
802
802
await SendAsync ( PingPayload . Instance , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
803
803
var payload = await ReceiveReplyAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
804
804
OkPayload . Create ( payload . Span , SupportsDeprecateEof , SupportsSessionTrack ) ;
805
805
if ( logInfo )
806
806
Log . Info ( "Session{0} successfully pinged server" , m_logArguments ) ;
807
807
else
808
- Log . Debug ( "Session{0} successfully pinged server" , m_logArguments ) ;
808
+ Log . Trace ( "Session{0} successfully pinged server" , m_logArguments ) ;
809
809
return true ;
810
810
}
811
811
catch ( IOException ex )
812
812
{
813
- Log . Debug ( ex , "Session{0} ping failed due to IOException" , m_logArguments ) ;
813
+ Log . Trace ( ex , "Session{0} ping failed due to IOException" , m_logArguments ) ;
814
814
}
815
815
catch ( MySqlException ex ) when ( ex . ErrorCode == MySqlErrorCode . ClientInteractionTimeout )
816
816
{
817
- Log . Debug ( ex , "Session{0} ping failed due to ClientInteractionTimeout MySqlException" , m_logArguments ) ;
817
+ Log . Trace ( ex , "Session{0} ping failed due to ClientInteractionTimeout MySqlException" , m_logArguments ) ;
818
818
}
819
819
catch ( SocketException ex )
820
820
{
821
- Log . Debug ( ex , "Session{0} ping failed due to SocketException" , m_logArguments ) ;
821
+ Log . Trace ( ex , "Session{0} ping failed due to SocketException" , m_logArguments ) ;
822
822
}
823
823
824
824
VerifyState ( State . Failed ) ;
@@ -1037,7 +1037,7 @@ private async Task<bool> OpenTcpSocketAsync(ConnectionSettings cs, ILoadBalancer
1037
1037
m_socket . SetKeepAlive ( cs . Keepalive ) ;
1038
1038
lock ( m_lock )
1039
1039
m_state = State . Connected ;
1040
- Log . Debug ( "Session{0} connected to IpAddress {1} for HostName '{2}' with local Port {3}" , m_logArguments [ 0 ] , ipAddress , hostName , ( m_socket . LocalEndPoint as IPEndPoint ) ? . Port ) ;
1040
+ Log . Trace ( "Session{0} connected to IpAddress {1} for HostName '{2}' with local Port {3}" , m_logArguments [ 0 ] , ipAddress , hostName , ( m_socket . LocalEndPoint as IPEndPoint ) ? . Port ) ;
1041
1041
return true ;
1042
1042
}
1043
1043
}
@@ -1238,7 +1238,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
1238
1238
{
1239
1239
// read the CA Certificate File
1240
1240
m_logArguments [ 1 ] = cs . CACertificateFile ;
1241
- Log . Debug ( "Session{0} loading CA certificate(s) from CertificateFile '{1}'" , m_logArguments ) ;
1241
+ Log . Trace ( "Session{0} loading CA certificate(s) from CertificateFile '{1}'" , m_logArguments ) ;
1242
1242
byte [ ] certificateBytes ;
1243
1243
try
1244
1244
{
@@ -1258,7 +1258,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
1258
1258
{
1259
1259
// load the certificate at this index; note that 'new X509Certificate' stops at the end of the first certificate it loads
1260
1260
m_logArguments [ 1 ] = index ;
1261
- Log . Debug ( "Session{0} loading certificate at Index {1} in the CA certificate file." , m_logArguments ) ;
1261
+ Log . Trace ( "Session{0} loading certificate at Index {1} in the CA certificate file." , m_logArguments ) ;
1262
1262
var caCertificate = new X509Certificate2 ( Utility . ArraySlice ( certificateBytes , index , ( nextIndex == - 1 ? certificateBytes . Length : nextIndex ) - index ) , default ( string ) , X509KeyStorageFlags . MachineKeySet ) ;
1263
1263
certificateChain . ChainPolicy . ExtraStore . Add ( caCertificate ) ;
1264
1264
}
@@ -1404,7 +1404,7 @@ X509CertificateCollection LoadCertificate(string sslKeyFile, string sslCertifica
1404
1404
throw new NotSupportedException ( "SslCert and SslKey connection string options are not supported in netstandard1.3 or netstandard2.0." ) ;
1405
1405
#elif NET45 || NET461 || NET471 || NETSTANDARD2_1 || NETCOREAPP2_1 || NETCOREAPP3_1
1406
1406
m_logArguments [ 1 ] = sslKeyFile ;
1407
- Log . Debug ( "Session{0} loading client key from KeyFile '{1}'" , m_logArguments ) ;
1407
+ Log . Trace ( "Session{0} loading client key from KeyFile '{1}'" , m_logArguments ) ;
1408
1408
string keyPem ;
1409
1409
try
1410
1410
{
@@ -1642,7 +1642,7 @@ private void VerifyState(State state1, State state2, State state3)
1642
1642
1643
1643
private byte [ ] CreateConnectionAttributes ( string programName )
1644
1644
{
1645
- Log . Debug ( "Session{0} creating connection attributes" , m_logArguments ) ;
1645
+ Log . Trace ( "Session{0} creating connection attributes" , m_logArguments ) ;
1646
1646
var attributesWriter = new ByteBufferWriter ( ) ;
1647
1647
attributesWriter . WriteLengthEncodedString ( "_client_name" ) ;
1648
1648
attributesWriter . WriteLengthEncodedString ( "MySqlConnector" ) ;
0 commit comments