[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eMemoryLogger\u003c/code\u003e class is a type of logger that stores log entries in an in-memory buffer, primarily intended for use during tests.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits from \u003ccode\u003eBaseLogger\u003c/code\u003e and provides methods for managing log levels, such as debug, info, warning, and error, in addition to offering functionalities like logging for specified types and throwing exceptions when null values are encountered.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eMemoryLogger\u003c/code\u003e is constructed with parameters for setting the minimum log level, maximum entry count, and an optional clock for time-stamping log entries.\u003c/p\u003e\n"],["\u003cp\u003eThe class exposes a \u003ccode\u003eLogEntries\u003c/code\u003e property, which is a list containing all logged messages as strings.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the MemoryLogger class is available under the Google.Apis.Logging namespace, specifically in version 1.69.0 of the Google.Apis package.\u003c/p\u003e\n"]]],[],null,["# Class MemoryLogger (1.69.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.69.0 (latest)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.MemoryLogger)\n- [1.68.0](/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Logging.MemoryLogger)\n- [1.60.0](/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Logging.MemoryLogger)\n- [1.59.0](/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Logging.MemoryLogger)\n- [1.55.0](/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Logging.MemoryLogger)\n- [1.50.0](/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Logging.MemoryLogger) \n\n public sealed class MemoryLogger : BaseLogger\n\nA logger than logs to an in-memory buffer.\nGenerally for use during tests. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [BaseLogger](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger) \\\u003e MemoryLogger \n\nInherited Members\n-----------------\n\n[BaseLogger.Clock](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Clock) \n[BaseLogger.LoggerForType](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_LoggerForType) \n[BaseLogger.MinimumLogLevel](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_MinimumLogLevel) \n[BaseLogger.IsDebugEnabled](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_IsDebugEnabled) \n[BaseLogger.IsInfoEnabled](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_IsInfoEnabled) \n[BaseLogger.IsWarningEnabled](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_IsWarningEnabled) \n[BaseLogger.IsErrorEnabled](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_IsErrorEnabled) \n[BaseLogger.ForType\\\u003cT\\\u003e()](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_ForType__1) \n[BaseLogger.ForType(Type)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_ForType_System_Type_) \n[BaseLogger.Debug(string, params object\\[\\])](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Debug_System_String_System_Object___) \n[BaseLogger.Info(string, params object\\[\\])](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Info_System_String_System_Object___) \n[BaseLogger.Warning(string, params object\\[\\])](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Warning_System_String_System_Object___) \n[BaseLogger.Error(Exception, string, params object\\[\\])](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Error_System_Exception_System_String_System_Object___) \n[BaseLogger.Error(string, params object\\[\\])](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Error_System_String_System_Object___) \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Apis.Logging](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging)\n\nAssembly\n--------\n\nGoogle.Apis.Core.dll\n\nConstructors\n------------\n\n### MemoryLogger(LogLevel, int, IClock)\n\n public MemoryLogger(LogLevel minimumLogLevel, int maximumEntryCount = 1000, IClock clock = null)\n\nConstruct a [MemoryLogger](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.MemoryLogger).\n\nProperties\n----------\n\n### LogEntries\n\n public IList\u003cstring\u003e LogEntries { get; }\n\nThe list of log entries.\n\nMethods\n-------\n\n### BuildNewLogger(Type)\n\n protected override ILogger BuildNewLogger(Type type)\n\nBuild a new logger of the derived concrete type, for use to log from the specified type.\n\n**Overrides** \n[BaseLogger.BuildNewLogger(Type)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_BuildNewLogger_System_Type_)\n\n### Log(LogLevel, string)\n\n protected override void Log(LogLevel logLevel, string formattedMessage)\n\nPerform the actual logging.\n\n**Overrides** \n[BaseLogger.Log(LogLevel, string)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Logging.BaseLogger#Google_Apis_Logging_BaseLogger_Log_Google_Apis_Logging_LogLevel_System_String_)\n\nExtension Method\n----------------\n\n[Utilities.ThrowIfNull\\\u003cT\\\u003e(T, string)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)"]]