0

for a multi-tenant app service, I would like to have a web server logging system stored in a storage container. I followed these steps and the logs are saved with the structure
ROOT_FOLDER_NAME_OF_WEB_APP/YEAR_FOLDER/MONTH_FOLDER/DAY_FOLDER/HOUR_FOLDER/random_file_name.log

Then I can write on this file with System.Diagnostics.Trace.TraceError("If you're seeing this, something bad happened");

Is there a way to manipulate the creation/usage of the Trace to achieve this structure? ROOT_FOLDER_NAME_OF_WEB_APP/TENANT_NAME/YEAR_FOLDER/MONTH_FOLDER/DAY_FOLDER/HOUR_FOLDER/filename_set_by_me.log

Thanks in advance

Community
  • 1
  • 1
Flacid_Snake
  • 391
  • 2
  • 5
  • 16
  • No, because the web app has no notion of tenants, as they are only known within your application. You could use a logging library and use that to create the structure you like. – Peter Bons Oct 11 '19 at 12:59
  • Thanks for your reply. I used Log4Net and I could create the desired structure, but it's stored inside the web app disk space at D:\home\LogFiles\AllMyStructure and not in the storage container – Flacid_Snake Oct 11 '19 at 13:14
  • You need to use or write a Log4Net appender that writes to azure blob storage like this one: https://github.com/Geta/log4net.Azure – Peter Bons Oct 11 '19 at 13:17

0 Answers0