简体   繁体   中英

How do I get log files from an azure cloud service

How do I get the log files from an azure cloud service / or the output from an azure cloud service.

I DO NOT mean the azure cloud logs, ie the logs produced by the management portal - I mean the actual output of my code.

If I run the code locally it goes to console, so I can see it, but how do I see it when it is running as an azure cloud service?

I am on VS2013 / .NET4.5 / Azure SDK2.4

thx

There are multiple ways of getting at your diagnostics logs. Most important question is, are you using a logging framework? If so, which one? There are a number of them available. Most have something for Azure so that your logs can be transferred to Azure storage, SQL Azure database, or just stored on your webserver as files. Seeing stuff on Console while you're debugging means that logging framework that you're using is outputting stuff to console, which is obviously pointless for non-debugging scenarios.

Log4net has plenty of appenders, one of them can store data in SQL azure database (the SQL appender), there are also appenders for Azure Table Storage.

If you're using Trace, you can have Azure move the trace logs for you automatically to Azure diagnostics storage account. You'll just need to configure Diagnostics in your Role (assuming you're using Web or WorkerRoles) to transfer Logs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM