Posted on 18/02/2016 14:08:40
Thanks guys, that's all very useful. However, it also shows the reason behind my initial question: there seem to be many different ways to log stuff ;-)
Just to name a few:
- Dynamicweb.LogToFile.Log(...); as suggested by Jeppe.
- Dynamicweb.Data.Providers.Logger.AddFileContentToLog as used in the integration framework. Seems to use Base.WriteTextFile under the hood.
- Dynamicweb.Information.Logger.LogGeneral: logs data in the GeneralLog table in the database.
- Dynamicweb.Ecommerce.LiveIntegration.Logger.Instance.Log()
In addition, I think there's a way to append logging information to an order in the backend and I am sure there are a few other ways to log data.
So, different ways to do similar things ;-)
My use cases:
1. Provide simple status information on an order under Ecommerce in the backend. Just like the checkout handler does, I would like to add additional messages to the order so a standard content manager can see them. Do I use the OrderDebuggingInfo class for that? I found the static Save method on that class which seems perfect for my scenario.
2. Provide low level data for developers to figure out what's going on. Dynamicweb.LogToFile.Log seems right, but I wonder if option #2 and #4 in the list above are better.
Thanks!
Imar