There is a method used to log message from extension, and here is how it looks:
OutSystems.HubEdition.RuntimePlatform.Log.GeneralLog.Write(DateTime instant, string sessionId, int espaceId, int tenantId, int userId, string message, string messageType, string moduleName, string errorId);
This is too complex to use, and most of the parameters can be determined by the logger itself. Whenever I need to do logging, I spend some time finding what to fill there, and usually I write helper method with much simpler interface, like this:
OutSystems.HubEdition.RuntimePlatform.Log.GeneralLog.Write(DateTime instant, string sessionId, int espaceId, int tenantId, int userId, string message, string messageType, string moduleName, string errorId);
This is too complex to use, and most of the parameters can be determined by the logger itself. Whenever I need to do logging, I spend some time finding what to fill there, and usually I write helper method with much simpler interface, like this:
private void Log(String message, String messageType)
{
var appInfo = AppInfo.GetAppInfo();
new GeneralLog().Write(DateTime.Now, appInfo.OsContext.Session.SessionID, appInfo.eSpaceId, appInfo.Tenant.Id, appInfo.OsContext.Session.UserId,
message, messageType, "ModuleName", "0");
}
Please add this kind of overload to GeneralLog class so that it's easier to use for everyone.
I don't know if using "moduleName" parameter makes sense, maybe there should be another overload accepting it, same about the last "errorId".
And "messageType" - this can be changed to enum, otherwise who knows what message types are available, or can just anything be used there? I also don't know if it's used at all - don't see it appearing in ServiceCenter.
Please add this kind of overload to GeneralLog class so that it's easier to use for everyone.
I don't know if using "moduleName" parameter makes sense, maybe there should be another overload accepting it, same about the last "errorId".
And "messageType" - this can be changed to enum, otherwise who knows what message types are available, or can just anything be used there? I also don't know if it's used at all - don't see it appearing in ServiceCenter.