I'm testing out Azure Webjobs. I wrote a console application which polls a SQL database for new work and processes it. I'm not using the WebJobs SDK because it only supports Azure Storage.
I upload the job, it runs, and then it fails with a exception that says it wasn't able to connect to the SQL Database instance. I'm wondering what connection string is being used; is it getting the connection string from the Azure Website. The logs give me this:
[03/14/2014 22:24:25 > 512206: SYS INFO] Status changed to Running
[03/14/2014 22:24:40 > 512206: ERR ]
[03/14/2014 22:24:40 > 512206: ERR ] Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I would like to write data to these logs (like what is the connection string that is being used). I tried Console.WriteLine, Debug.WriteLine, Console.Error.WriteLine. None of them show up in the in my WebJob log.
Apparently I could get the data by just raising an exception with the message text showing what I want, but there must be a better way! How do I write SYS INFO lines and ERR lines to the log?