Skip to content

Commit 56774e9

Browse files
committed
Reduce most Warn logging to Info.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent 819f769 commit 56774e9

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/MySqlConnector/Core/CachedProcedure.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ internal sealed class CachedProcedure
5151
}
5252
catch (MySqlException ex)
5353
{
54-
Log.Warn("Session{0} failed to retrieve metadata for Schema={1} Component={2}; falling back to INFORMATION_SCHEMA. Error: {3}", connection.Session.Id, schema, component, ex.Message);
54+
Log.Info("Session{0} failed to retrieve metadata for Schema={1} Component={2}; falling back to INFORMATION_SCHEMA. Error: {3}", connection.Session.Id, schema, component, ex.Message);
5555
if (ex.ErrorCode == MySqlErrorCode.TableAccessDenied)
5656
connection.Session.ProcAccessDenied = true;
5757
}
5858
}
5959

6060
if (connection.Session.ServerVersion.Version < ServerVersions.SupportsProcedureCache)
6161
{
62-
Log.Warn("Session{0} ServerVersion={1} does not support cached procedures", connection.Session.Id, connection.Session.ServerVersion.OriginalString);
62+
Log.Info("Session{0} ServerVersion={1} does not support cached procedures", connection.Session.Id, connection.Session.ServerVersion.OriginalString);
6363
return null;
6464
}
6565

src/MySqlConnector/Core/CommandExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static async Task<MySqlDataReader> ExecuteReaderAsync(IReadOnlyList<IMySq
6161
}
6262
catch (MySqlException ex) when (ex.ErrorCode == MySqlErrorCode.QueryInterrupted && cancellationToken.IsCancellationRequested)
6363
{
64-
Log.Warn("Session{0} query was interrupted", connection.Session.Id);
64+
Log.Info("Session{0} query was interrupted", connection.Session.Id);
6565
throw new OperationCanceledException(ex. Message, ex, cancellationToken);
6666
}
6767
catch (Exception ex) when (payload.Span.Length > 4_194_304 && (ex is SocketException or IOException or MySqlProtocolException))

src/MySqlConnector/Core/ConnectionPool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public async ValueTask<ServerSession> GetSessionAsync(MySqlConnection connection
8383
if (!reuseSession)
8484
{
8585
// session is either old or cannot communicate with the server
86-
Log.Warn("Pool{0} Session{1} is unusable; destroying it", m_logArguments[0], session.Id);
86+
Log.Info("Pool{0} Session{1} is unusable; destroying it", m_logArguments[0], session.Id);
8787
AdjustHostConnectionCount(session, -1);
8888
await session.DisposeAsync(ioBehavior, cancellationToken).ConfigureAwait(false);
8989
}
@@ -181,7 +181,7 @@ public async ValueTask ReturnAsync(IOBehavior ioBehavior, ServerSession session)
181181
else
182182
{
183183
if (sessionHealth == 1)
184-
Log.Warn("Pool{0} received invalid Session{1}; destroying it", m_logArguments[0], session.Id);
184+
Log.Info("Pool{0} received invalid Session{1}; destroying it", m_logArguments[0], session.Id);
185185
else
186186
Log.Debug("Pool{0} received expired Session{1}; destroying it", m_logArguments[0], session.Id);
187187
AdjustHostConnectionCount(session, -1);

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,13 @@ public async Task DisposeAsync(IOBehavior ioBehavior, CancellationToken cancella
472472
}
473473
catch (ArgumentException ex) when (ex.ParamName == "sslProtocolType" && sslProtocols == SslProtocols.None)
474474
{
475-
Log.Warn(ex, "Session{0} doesn't support SslProtocols.None; falling back to explicitly specifying SslProtocols", m_logArguments);
475+
Log.Debug(ex, "Session{0} doesn't support SslProtocols.None; falling back to explicitly specifying SslProtocols", m_logArguments);
476476
sslProtocols = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12;
477477
}
478478
catch (Exception ex) when (shouldRetrySsl && ((ex is MySqlException && ex.InnerException is IOException) || ex is IOException))
479479
{
480480
// negotiating TLS 1.2 with a yaSSL-based server throws an exception on Windows, see comment at top of method
481-
Log.Warn(ex, "Session{0} failed negotiating TLS; falling back to TLS 1.1", m_logArguments);
481+
Log.Debug(ex, "Session{0} failed negotiating TLS; falling back to TLS 1.1", m_logArguments);
482482
sslProtocols = SslProtocols.Tls | SslProtocols.Tls11;
483483
if (Pool is not null)
484484
Pool.SslProtocols = sslProtocols;

src/MySqlConnector/MySqlBulkCopy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static void AddColumnMapping(List<MySqlBulkCopyColumnMapping> columnMappings, bo
340340
{
341341
if (columnMapping.Expression is not null)
342342
{
343-
Log.Warn("Column mapping for SourceOrdinal {0}, DestinationColumn {1} already has Expression {2}", columnMapping.SourceOrdinal, destinationColumn, columnMapping.Expression);
343+
Log.Info("Column mapping for SourceOrdinal {0}, DestinationColumn {1} already has Expression {2}", columnMapping.SourceOrdinal, destinationColumn, columnMapping.Expression);
344344
}
345345
else
346346
{

src/MySqlConnector/MySqlConnection.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ internal void Cancel(ICancellableCommand command, int commandId, bool isCancel)
723723
catch (MySqlException ex)
724724
{
725725
// cancelling the query failed; setting the state back to 'Querying' will allow another call to 'Cancel' to try again
726-
Log.Warn(ex, "Session{0} cancelling CommandId {1} failed", m_session!.Id, command.CommandId);
726+
Log.Info(ex, "Session{0} cancelling CommandId {1} failed", m_session!.Id, command.CommandId);
727727
m_session.AbortCancel(command);
728728
}
729729
}
@@ -738,14 +738,14 @@ internal void Cancel(ICancellableCommand command, int commandId, bool isCancel)
738738
var cachedProcedures = m_session!.Pool?.GetProcedureCache() ?? m_cachedProcedures;
739739
if (cachedProcedures is null)
740740
{
741-
Log.Warn("Session{0} pool Pool{1} doesn't have a shared procedure cache; procedure will only be cached on this connection", m_session.Id, m_session.Pool?.Id);
741+
Log.Info("Session{0} pool Pool{1} doesn't have a shared procedure cache; procedure will only be cached on this connection", m_session.Id, m_session.Pool?.Id);
742742
cachedProcedures = m_cachedProcedures = new();
743743
}
744744

745745
var normalized = NormalizedSchema.MustNormalize(name, Database);
746746
if (string.IsNullOrEmpty(normalized.Schema))
747747
{
748-
Log.Warn("Session{0} couldn't normalize Database={1} Name={2}; not caching procedure", m_session.Id, Database, name);
748+
Log.Info("Session{0} couldn't normalize Database={1} Name={2}; not caching procedure", m_session.Id, Database, name);
749749
return null;
750750
}
751751

@@ -756,10 +756,10 @@ internal void Cancel(ICancellableCommand command, int commandId, bool isCancel)
756756
if (!foundProcedure || (cachedProcedure is null && revalidateMissing))
757757
{
758758
cachedProcedure = await CachedProcedure.FillAsync(ioBehavior, this, normalized.Schema!, normalized.Component!, cancellationToken).ConfigureAwait(false);
759-
if (Log.IsWarnEnabled())
759+
if (Log.IsInfoEnabled())
760760
{
761761
if (cachedProcedure is null)
762-
Log.Warn("Session{0} failed to cache procedure Schema={1} Component={2}", m_session.Id, normalized.Schema, normalized.Component);
762+
Log.Info("Session{0} failed to cache procedure Schema={1} Component={2}", m_session.Id, normalized.Schema, normalized.Component);
763763
else
764764
Log.Trace("Session{0} caching procedure Schema={1} Component={2}", m_session.Id, normalized.Schema, normalized.Component);
765765
}
@@ -773,10 +773,10 @@ internal void Cancel(ICancellableCommand command, int commandId, bool isCancel)
773773
Log.Trace("Session{0} procedure cache Count={1}", m_session.Id, count);
774774
}
775775

776-
if (Log.IsWarnEnabled())
776+
if (Log.IsInfoEnabled())
777777
{
778778
if (cachedProcedure is null)
779-
Log.Warn("Session{0} did not find cached procedure Schema={1} Component={2}", m_session.Id, normalized.Schema, normalized.Component);
779+
Log.Info("Session{0} did not find cached procedure Schema={1} Component={2}", m_session.Id, normalized.Schema, normalized.Component);
780780
else
781781
Log.Trace("Session{0} returning cached procedure Schema={1} Component={2}", m_session.Id, normalized.Schema, normalized.Component);
782782
}

0 commit comments

Comments
 (0)