All,
We have a legacy MicroStation application which has been problem-free but which was recently tested running on MicroStation 10.15.00.74. The application runs as an INITAPP and never calls mdlSystem_enterGraphics. Upon calling mdlSystem_newDesignFile, the following error is displayed in the Text Window:
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [createpath] to set object on [log4net.Appender.RollingFileAppender]
Any idea what could cause this behavior and/or possible workarounds?
TIA
Steve
Steve Salata said:Upon calling mdlSystem_newDesignFile, the following error is displayed in the Text Window:
Does your code wait until file open completes? In v8, that was mdlSystem_setFunction(), which in CONNECT is type-safe SystemFunc_NewDesignFile.
mdlSystem_setFunction()
SystemFunc_NewDesignFile
Regards, Jon Summers LA Solutions
Hi Jon
Thanks for the good suggestion but the log4net error is displayed before the newFileDesign system callback function is even called.
The
mdlSystem_newDesignFile
Steve Salata said:We have a legacy MicroStation application which has been problem-free
On earlier versions (i.e. V8) of MicroStation or an earlier update of CONNECT?
Please post your MdlMain() function code.
MdlMain()
Not much to the main function code, but here it is:
extern "C" DLLEXPORT void MdlMain ( int argc, /* => Number of arguments passed in pargv */ WCharCP argv[] /* => Array of pointers to arguments */ ) { RscFileHandle rfHandle; /* resource file handle */ if (argc <= 2) { mdlOutput_printf(MSG_ERROR, L"ERROR: This program cannot be run interactively."); return; } mdlResource_openFile(&rfHandle, NULL, FALSE); SystemCallback::SetReloadProgramFunction (reloadProgram); SystemCallback::SetNewDesignFileFunction(newDesignFile); handleArgs(argc, argv); mdlSystem_closeDesignFile(); }
Steve Salata said:Not much to the main function code
Less to go wrong! What happens in handleArgs? Presumably, you're opening one or more DGN files for processing?
handleArgs
Yes, handleArgs opens/updates a series of design files. The log4net error appears on the first call to mdlSystem_newDesignFile but does not prevent successful processing of any design file.
mdl
System_newDesignFile
Perhaps Robert Hook can tell us the purpose of log4net?
Hi Steve Salata,
Thank you for reporting this issue. We have confirmed this and discovered this was an accidental development debug trace that remained enabled. Hopefully the next product update(s) should remove this trace alert from being visible.
Jon Summers said:Perhaps Robert Hook can tell us the purpose of log4net?
Hi Jon Summers,
Log4J, Log4net and Log4cxx (cpp) are all similar industrial grade logging systems a number of Bentley products have implemented to various degrees over the years. The fundamental concept is that a product implements a centralized logger that is easily configured using one or more application (category) XML files. The product initializes the logger and then applications can participate in attaching to the primary logger and producing high frequency/volume logging and written to one of many preferred standardized output streams (txt, xml, stream, databases, etc.). We use these logging systems heavily in our ProjectWise client and server applications and can be used to create multi-million lines of sequenced logging in very short periods of time if/as needed.
Thank you and HTH,Bob
[UPDATE-20220303-RH: New conditions related to certain MS_DESIGN_HISTORY value combinations have been identified as a trigger. A new Bug 812993 has been filed to address the behaviors found and to become available in a future build - again, hopefully the next Commercial Release (CR).
Answer Verified By: Steve Salata
Thanks for the detailed explanation.
Robert Hook said:can be used to create multi-million lines of sequenced logging
Who has time to read through millions of lines of logging?
Jon Summers said:Who has time to read through millions of lines of logging?
There is typically no reason, why anybody should read complete logs with millions of lines ... probably it would be a proof of bad application or operation design.
Log4xxx (which has been part of my probably all applications for last few years ;-) can be easily configured to store logs in database(s). It allows to monitor logs automatically and to analyze selected data only. And the result of such analysis is, when needed, reviewed by a human.
It's not typical for desktop applications, but I remember presentation on some conference about monitoring server streaming system. IT director explained how they log about 5000 parameters in parallel, ever second, to be able to track (and try to predict using AI) unexpected issues ;-)
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point