Server logging for Aras 31

Hello Experts,

As the title says, we are on Aras 31 and building some custom code in a dll, trying to understand the new way of logging in C# classes

Looking at the release notes here, there is a new way to add logs, the extract from that document

ASP.NET Core native logging mechanism (ILogger and ILoggerFactory) is available in CallContext public object. This mechanism uses server's log configuration and writes server methods logs along with other server's logs. Developers of server methods should use this mechanism for new development. Old public log API in CallContext is depracated with appropriate messages and will be removed in the future

We could not find any documentation on this, the below is the sample we tried but it does not work

CallContext CCO = ((IOMConnection)_inn.getConnection()).CCO;
ILogger _logger = CCO.Logger;
_logger.LogDebug("Print something");

Do we have an example on how this can be configured?

Can someone please point me in the right direction on this, thanks 

  • I don´t have an answer, but I support this question! All the mentioned updates regarding Server logging sound useful. I like the unified logs for the various sub servers. But so far I haven´t tested any of the logging features in I14.

    Right now even the latest R33 programmers guide only lists the classic standard log function:

    CCO.Utilities.WriteDebug("logFileName", "logMessage");

    Out of interest: Do you get the mentioned depracted message when using this classic variant?

  • From the Aras method editor, and also from my dll,  i do see a warning

    Line number 2, Warning Number: CS0618, 'Utilities.WriteDebug(string, string)' is obsolete: 'Obsolete since 14.0. Use CallContext.Logger instead.'

  • Hi Sudhir,

    Try this instead:

    CCO.Logger.LogError('message');

    I'll file a doc issue to update the programmer's guide with the right sample.