You can use trace.writeline with both mode release and debug the only required thing is in web.config you should have trace enabled.
See this link - Trace.WriteLine in release mode?
If you want to output your trace.writeline then you need to add tracelistner. See following - http://msdn.microsoft.com/en-us/library/system.diagnostics.tracelistener.aspx
Following links are example how you can create trace listners.
http://msdn.microsoft.com/en-us/library/ff650498.aspx http://www.codeproject.com/Articles/2680/Writing-custom-NET-trace-listeners