@@ -46,7 +46,7 @@ public ServerSession(ConnectionPool? pool, int poolGeneration, int id)
4646 PoolGeneration = poolGeneration ;
4747 HostName = "" ;
4848 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 ) ;
5050 }
5151
5252 public string Id { get ; }
@@ -74,10 +74,10 @@ public ValueTask<int> ReturnToPoolAsync(IOBehavior ioBehavior, MySqlConnection?
7474 public ValueTask ReturnToPoolAsync ( IOBehavior ioBehavior , MySqlConnection ? owningConnection )
7575#endif
7676 {
77- if ( Log . IsDebugEnabled ( ) )
77+ if ( Log . IsTraceEnabled ( ) )
7878 {
7979 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 ) ;
8181 }
8282 LastReturnedTicks = unchecked ( ( uint ) Environment . TickCount ) ;
8383 if ( Pool is null )
@@ -296,7 +296,7 @@ public void StartQuerying(ICancellableCommand command)
296296 public void FinishQuerying ( )
297297 {
298298 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 ) ;
300300 bool clearConnection = false ;
301301 lock ( m_lock )
302302 {
@@ -432,7 +432,7 @@ public async Task DisposeAsync(IOBehavior ioBehavior, CancellationToken cancella
432432 else
433433 authPluginName = ( initialHandshake . ProtocolCapabilities & ProtocolCapabilities . SecureConnection ) == 0 ? "mysql_old_password" : "mysql_native_password" ;
434434 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 ) ;
436436 if ( authPluginName != "mysql_native_password" && authPluginName != "sha256_password" && authPluginName != "caching_sha2_password" )
437437 {
438438 Log . Error ( "Session{0} unsupported authentication method AuthPluginName={1}" , m_logArguments ) ;
@@ -547,7 +547,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
547547 if ( DatabaseOverride is null && ( ServerVersion . Version . CompareTo ( ServerVersions . SupportsResetConnection ) >= 0 || ServerVersion . MariaDbVersion ? . CompareTo ( ServerVersions . MariaDbSupportsResetConnection ) >= 0 ) )
548548 {
549549 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 ) ;
551551 await SendAsync ( ResetConnectionPayload . Instance , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
552552 payload = await ReceiveReplyAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
553553 OkPayload . Create ( payload . Span , SupportsDeprecateEof , SupportsSessionTrack ) ;
@@ -558,7 +558,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
558558 if ( DatabaseOverride is null )
559559 {
560560 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 ) ;
562562 }
563563 else
564564 {
@@ -572,7 +572,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
572572 payload = await ReceiveReplyAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
573573 if ( payload . HeaderByte == AuthenticationMethodSwitchRequestPayload . Signature )
574574 {
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 ) ;
576576 payload = await SwitchAuthenticationAsync ( cs , payload , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
577577 }
578578 OkPayload . Create ( payload . Span , SupportsDeprecateEof , SupportsSessionTrack ) ;
@@ -587,19 +587,19 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
587587 }
588588 catch ( IOException ex )
589589 {
590- Log . Debug ( ex , "Session{0} ignoring IOException in TryResetConnectionAsync" , m_logArguments ) ;
590+ Log . Trace ( ex , "Session{0} ignoring IOException in TryResetConnectionAsync" , m_logArguments ) ;
591591 }
592592 catch ( MySqlException ex ) when ( ex . ErrorCode == MySqlErrorCode . ClientInteractionTimeout )
593593 {
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 ) ;
595595 }
596596 catch ( ObjectDisposedException ex )
597597 {
598- Log . Debug ( ex , "Session{0} ignoring ObjectDisposedException in TryResetConnectionAsync" , m_logArguments ) ;
598+ Log . Trace ( ex , "Session{0} ignoring ObjectDisposedException in TryResetConnectionAsync" , m_logArguments ) ;
599599 }
600600 catch ( SocketException ex )
601601 {
602- Log . Debug ( ex , "Session{0} ignoring SocketException in TryResetConnectionAsync" , m_logArguments ) ;
602+ Log . Trace ( ex , "Session{0} ignoring SocketException in TryResetConnectionAsync" , m_logArguments ) ;
603603 }
604604
605605 if ( returnToPool && Pool is not null )
@@ -618,7 +618,7 @@ private async Task<PayloadData> SwitchAuthenticationAsync(ConnectionSettings cs,
618618 // if the server didn't support the hashed password; rehash with the new challenge
619619 var switchRequest = AuthenticationMethodSwitchRequestPayload . Create ( payload . Span ) ;
620620 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 ) ;
622622 switch ( switchRequest . Name )
623623 {
624624 case "mysql_native_password" :
@@ -798,27 +798,27 @@ public async ValueTask<bool> TryPingAsync(bool logInfo, IOBehavior ioBehavior, C
798798 // send ping payload to verify client and server socket are still connected
799799 try
800800 {
801- Log . Debug ( "Session{0} pinging server" , m_logArguments ) ;
801+ Log . Trace ( "Session{0} pinging server" , m_logArguments ) ;
802802 await SendAsync ( PingPayload . Instance , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
803803 var payload = await ReceiveReplyAsync ( ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
804804 OkPayload . Create ( payload . Span , SupportsDeprecateEof , SupportsSessionTrack ) ;
805805 if ( logInfo )
806806 Log . Info ( "Session{0} successfully pinged server" , m_logArguments ) ;
807807 else
808- Log . Debug ( "Session{0} successfully pinged server" , m_logArguments ) ;
808+ Log . Trace ( "Session{0} successfully pinged server" , m_logArguments ) ;
809809 return true ;
810810 }
811811 catch ( IOException ex )
812812 {
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 ) ;
814814 }
815815 catch ( MySqlException ex ) when ( ex . ErrorCode == MySqlErrorCode . ClientInteractionTimeout )
816816 {
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 ) ;
818818 }
819819 catch ( SocketException ex )
820820 {
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 ) ;
822822 }
823823
824824 VerifyState ( State . Failed ) ;
@@ -1037,7 +1037,7 @@ private async Task<bool> OpenTcpSocketAsync(ConnectionSettings cs, ILoadBalancer
10371037 m_socket . SetKeepAlive ( cs . Keepalive ) ;
10381038 lock ( m_lock )
10391039 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 ) ;
10411041 return true ;
10421042 }
10431043 }
@@ -1238,7 +1238,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
12381238 {
12391239 // read the CA Certificate File
12401240 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 ) ;
12421242 byte [ ] certificateBytes ;
12431243 try
12441244 {
@@ -1258,7 +1258,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
12581258 {
12591259 // load the certificate at this index; note that 'new X509Certificate' stops at the end of the first certificate it loads
12601260 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 ) ;
12621262 var caCertificate = new X509Certificate2 ( Utility . ArraySlice ( certificateBytes , index , ( nextIndex == - 1 ? certificateBytes . Length : nextIndex ) - index ) , default ( string ) , X509KeyStorageFlags . MachineKeySet ) ;
12631263 certificateChain . ChainPolicy . ExtraStore . Add ( caCertificate ) ;
12641264 }
@@ -1404,7 +1404,7 @@ X509CertificateCollection LoadCertificate(string sslKeyFile, string sslCertifica
14041404 throw new NotSupportedException ( "SslCert and SslKey connection string options are not supported in netstandard1.3 or netstandard2.0." ) ;
14051405#elif NET45 || NET461 || NET471 || NETSTANDARD2_1 || NETCOREAPP2_1 || NETCOREAPP3_1
14061406 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 ) ;
14081408 string keyPem ;
14091409 try
14101410 {
@@ -1642,7 +1642,7 @@ private void VerifyState(State state1, State state2, State state3)
16421642
16431643 private byte [ ] CreateConnectionAttributes ( string programName )
16441644 {
1645- Log . Debug ( "Session{0} creating connection attributes" , m_logArguments ) ;
1645+ Log . Trace ( "Session{0} creating connection attributes" , m_logArguments ) ;
16461646 var attributesWriter = new ByteBufferWriter ( ) ;
16471647 attributesWriter . WriteLengthEncodedString ( "_client_name" ) ;
16481648 attributesWriter . WriteLengthEncodedString ( "MySqlConnector" ) ;
0 commit comments