In 10.2 loglines are truncated after little more than 5000 characters.
The only solution to log info > 5000 is - according to https://community.dataminer.services/question/logging-in-10-2-loglines-are-truncated-afterlittle-more-than-5000-characters-how-to-avoid-that/ - to implement a loop in which 5000 characters are logged consequently.
To do that I like to get the current loglevel and/or logtype, so that only in debug level mode, this loop needs to be executed.
Something like:
if (protocol.LogType == LogType.DebugInfo)
loop in which protocol.Log(reqString.Substring(i,j), LogType.DebugInfo, LogLevel.Level1);
else
protocol.Log(reqString, LogType.Allways, LogLevel.LogEverything);
Hi Cristel,
I'm not aware of a method to know the current log level of an element. In some situations that could indeed be useful. It may be possbile to retrieve this information through an SLNet message.
However, the impact on performance of such small loop will probably be negligible. The loglevel that is provided in the method call is already being compared by DataMiner with the current setting and is only writted to the file when necessary.
Hi Cristel,
The length limit of a single log statement can be a hindrance in test scenarios, and perhaps a different storage location may be needed if investigation this amount of data is required, as the logging is intended for checking the status of a process or get a stack trace of an exception.
That being said, the log levels are not accessible as Tom W. mentioned earlier, but it is something we are likely going to add as device communication is migrating to QActions with the use of middlewares and DLLs that provide a communication API. There is currently no timeline for this, but more requests and good use-cases will likely bump this up in priority.