I know that Bentley has included log4net into their API, trying to figure out if can I log my own information in a separate log. Does anyone have any examples?
Hi Mike,
I have not done any tests yet, but my opinion, expressed in the discussion linked by Jon, is still the same :-)
Mike Robertson said:I know that Bentley has included log4net into their API
I am not sure whether log4net is "included in API". Log4net is now part of MicroStation installation, used by MicroStation itself, similarly to Newtonsoft.Json and (I guess) other popular libraries.
Mike Robertson said:trying to figure out if can I log my own information in a separate log
Even when packed into custom assembly (Bentley.logging.log4net-2.0.dll), available API is standard Log4net API, so you should be able to do it in "standard Log4net way". Just reference this assembly to your project, ensure it is not copied to target folder (I assume / I hope it will be found automatically in MicroStation runtime) and use the logger API.
Mike Robertson said:Does anyone have any examples?
Did you try to use any Log4net tutorial? I am aware usually tutorials start with xml logger configuration (which is probably not the best option for MicroStation addins), but the logger can be configured also through code.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
We have added the Bentley.logging.log4net-2.0.dll reference and can see the objects in the object browser. We use log4net in our stand-alone applications with no problems but have not been able to use the same patterns using the Bentley API thus the request for examples. I'll get one of our programmers to send me what they have tried and I'll post example code.
Mike Robertson said:but have not been able to use the same patterns using the Bentley API
Can you share more details what do you mean by this statement? Not very clear to me...
Regards,