Is it possible to enable debug log level on the instance?

I am setting the event type to debug, but the Events page does not display any logs for that level. Is it possible to set it up?

Doesn't work for In-process API and for Script API using "Debug" value for EventType

 EventLogEntryWriteOptions In-Process API Supplementary Type 

 core_v2_eventLog Script API 

No results in Events:

Parents Reply Children
  •  , to summarize, Iurii's code above is ok, but that's .NET code for plugins

    For TE-17080, what will be the changed behavior?

  • Former Member
    0 Former Member in reply to John Reynolds

    Will need to let the bug go through planning to be certain of any behavior changes.

    But as currently implemented, the code above will return an error when called, that "Debug" is not a valid EventType.

  • Debug message output using In-Process API is also not supported. Just to avoid the wrappers, a simple plugin to reproduce the problem:

    using System.Linq;
    using Telligent.Evolution.Extensibility;
    using Telligent.Evolution.Extensibility.Api.Version1;
    using Telligent.Evolution.Extensibility.Version1;
    
    namespace LogLevelTestAssembly
    {
        public class LogLevelTestPlugin : IPlugin
        {
            public string Name => "Log level extension";
            public string Description => string.Empty;
    
            /// <summary>
            /// Log message for each EventType
            /// </summary>
            private void Write(string message)
            {
                var coreLogger = Apis.Get<IEventLog>();
    
                // It works
                coreLogger.Write(message, new EventLogEntryWriteOptions() { EventType = "Information" });
    
                // It works
                coreLogger.Write(message, new EventLogEntryWriteOptions() { EventType = "Warning" });
    
                // It works
                coreLogger.Write(message, new EventLogEntryWriteOptions() { EventType = "Error" });
    
    
    
                // NOTE: debug level
                var debugResponse = coreLogger.Write(message, new EventLogEntryWriteOptions() { EventType = "Debug" });
    
                // NOTE: checking debug response (the output result can be seen in the "Error" EventType category)
                if (debugResponse.HasErrors())
                {
                    var debugOutput = "Debug error message: " + string.Join(",", debugResponse.Errors.Select(e => e.Message).ToArray());
                    coreLogger.Write(debugOutput, new EventLogEntryWriteOptions() { EventType = "Error" });
                }
            }
    
    
            public void Initialize()
            {
                Write($"{Name}. Initialize.");
    
                var coreContents = Apis.Get<IContents>();
                coreContents.Events.AfterCreate += ContentAfterCreate;
            }
    
            private void ContentAfterCreate(ContentAfterCreateEventArgs e)
            {
                Write($"Content created. Id: {e.ContentId}");
            }
        }
    }
    

    Visual result on the event page:

  • It should be made clear, no one should use EventLogs.Write(...).  It is not a supported API and can be changed or removed without notice.  You should only use the supported API