This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am initialising the Logger class as follows: uow.Context.Logger = new TraceLogger(); where can I see the results of the TraceLogger? I cannot see it in a debug or command window.. Am I missing something? |
|
|
It will appear in the Visual Studio Output window when running under the debugger. (Actually, it uses the standard .NET trace facility, and you can use the app.config file to configure where the trace facility sends messages; but the default is the Output window.) |
|
|
Hi, Is there anything else obvious to look out for? I have created a new MVC app, and I cannot get lightspeed to output anything to the debug window. If I Trace.Write it output OK - It must be something obvious that I just cannot see as I'm sure I've had this working before. The LS Model is in a separate project in the same solution, I have the the LS context setup in the web.config and the app actually works - but I cannot get the SQL output to debug window. Any suggestions? Cheers |
|
|
There shouldn't be anything else you need to do. The only thing I can think of is that the logger has been set on the wrong context. Try doing this: Trace.WriteLine(uow.Context.Logger.GetType().Name); and verify that it prints "TraceLogger". If on the other hand you get a NullReferenceException then this means no logger is defined on this context. If this is the case but everything else is working fine it may mean you are copying settings from one context to another. At one point we had a screencast up which incorrectly showed loading a context from configuration, copying settings to another context and then using that second context. This is a bad thing because it's easy to forget to copy obscure settings like the logger, but it's possible you saw the incorrect version of the screencast and inherited this error from us. Could that be it? If so, just get rid of the copying code and use the configured context directly. |
|
|
Thanks Ivan - That sorted me - It was set up with the ConsoleLogger - which I did thought would still output to the debug window - but I have corrected to TraceLogger now and can see the SQL etc now :-) Thanks again. |
|