Logging in Website module

In the Website module (C# code), there is a scenario where I want to log an informational message. I am making use of the static method ApplicationLogger.LogInfo(). The documentation of this method says by default it will log to LogName.AppSystem, which is the application system log. Here is the code I am using as a test: > string msg = "A test message."; > > ApplicationLogger.LogInfo(key: "Cobalt.My.New.Key", message: msg); When I run locally, I can see the message in my D:\data\logs\Application\App_xml.log file. My question is once this gets deployed to the testing environments and then PROD, where will I find the message? In ErrorGUI? In TRMR? Or is there another tool where I will be able to see it? My use case is one where this message isn't really an error, so that's why I am logging an informational message. This shouldn't be that frequent at all, so filling up logs is not a concern.

Best Answer

Answers

  • Coincidentally working with Error GUI today. I had an issue trying to log things in Error GUI in the Search module. I know that in java I had to use a class called: com.trgr.cobalt.search.logging.errorlogging.ErrorLogger Perhaps in the C# modules you have an import with a similar class in it as well? But once you have the correct logger in a java module at least, the code that must execute to write the information to Error GUI gets hit and it will still log the error to the console. I'm fairly certain it would operate the same way in a C# module. Alternatively of course, as Ryan Morlock has suggested, you can use Splunk but this is only available for QED and PROD.