Hi
My service is used by mobile and i want to profiling my service when debugging.
I find ProfiledDbConnection can give me a good view to see the sql. I paste a url in the browser(get method) and then i can sea the report. But i don’t know if i use ajax(postman) or mobile client(mobile) to post a request, how do i see results.
And is there a flag i can check and then the sql of generating by Ormlite will output in the console? I can check the generation while developing.
Register your preferred Logging Provider so you can view your App Logs, and initialize the LogFactory with debugEnabled:true so you enable Debug logging.
My log is here #if DEBUG
LogManager.LogFactory = new DebugLogFactory(debugEnabled: true);//or console log #else
//Also runs log4net.Config.XmlConfigurator.Configure()
LogManager.LogFactory = new Log4NetFactory(configureLog4Net: true); #endif
and i print Log.Debug(Db.GetLastSql());
But when i debug the service, i can not see sql in the output window of Visual Studio. while Log4NetFactory is ok, i can see log in the log file.
Could you tell me where to find console output?
I want to print Profiler details(include sql) in the log, could i do this.
The debug logging shows everything that gets logged, i.e if you enable debugLogging:true OrmLite logs the executed SQL. The latest v4.0.43+ on MyGet also logs DB Params and SQL for INSERT/UPDATE/DELETE statements.