locked
App Service Application logs with .txt missing, instead a different type of log with .csv found. RRS feed

  • Question

  • User246635104 posted

    I have two App Services with the same binaries and logging setup, with both configured similarly under Diagnostic <g class="gr_ gr_130 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="130" data-gr-id="130">logs</g>.
    Each one logs to its own blob container, and to test, I also enable file system logging.

    My test-env <g class="gr_ gr_223 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="223" data-gr-id="223">webapp</g> logs correctly - the blob container contains append blobs ending in .txt containing Logger output.
    My prod-env <g class="gr_ gr_367 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="367" data-gr-id="367">webapp</g> only logs block blobs ending in .csv, with no Logger output from my application.

    Inspecting with Kudu, the test-env <g class="gr_ gr_558 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="558" data-gr-id="558">webapp</g> contains, in the filesystem  a folder under LogFiles/Application with files such as diagnostics-20181227.txt
    the prod-env <g class="gr_ gr_645 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="645" data-gr-id="645">webapp</g> contains no such folder when inspecting with Kudu.

    What possible cause could there be for my prod-env <g class="gr_ gr_760 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="760" data-gr-id="760">webapp</g> to not <g class="gr_ gr_81 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="81" data-gr-id="81">log ,</g> not even to the file system (nothing in Log Stream), despite having Application Logging (File System) ON?
    And why would I get the <g class="gr_ gr_21 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="21" data-gr-id="21">csv</g> files instead of <g class="gr_ gr_242 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="242" data-gr-id="242">txt</g> - is the inclusion of the .csv type related?



    Thursday, December 27, 2018 2:11 PM

All replies

  • User283571144 posted

    Hi oofpez,

    My test-env webapp logs correctly - the blob container contains append blobs ending in .txt containing Logger output.
    My prod-env webapp only logs block blobs ending in .csv, with no Logger output from my application.

    Inspecting with Kudu, the test-env webapp contains, in the filesystem  a folder under LogFiles/Application with files such as diagnostics-20181227.txt
    the prod-env webapp contains no such folder when inspecting with Kudu.

    What possible cause could there be for my prod-env webapp to not log , not even to the file system (nothing in Log Stream), despite having Application Logging (File System) ON?
    And why would I get the csv files instead of txt - is the inclusion of the .csv type related?

    As far as I know, when logging to blob storage, data is stored in comma-separated values (CSV) format. Additional fields are logged to provide more granular information about the event.

    If you only enable the blob storage , it will only log the data into blob with CSV format. If you enable both filesystem and blob in diagnostics logs, it wil log the text file in the web app's file folder and log the csv file into the blob.

    So you will find the text file in the test-env webapp and couldn't find the  text file in the prod-env webapp.

    More details, you could refer to below article:

    Enable diagnostics logging for apps in Azure App Service

    Best Regards,

    Brando

    Friday, December 28, 2018 2:18 AM
  • User246635104 posted

    I think this is associated with an update of the Asp.Net Core Logging site extension to 2.2 from the previous Asp.Net Core Extension.
    When I made the two app services have the same site extension the prod-env was on, neither of them <g class="gr_ gr_64 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="64" data-gr-id="64">are</g> logging .txt and both are only logging .csv traces.

    I'd like to revert to the old site extension but unsure how.

    Friday, December 28, 2018 12:31 PM
  • User283571144 posted

    Hi oofpez,

    As far as I know, azure web app diagnostic will not add csv file by default no matter you use which asp.net core version.

    Do you enable any other log extension in your application? like nlog?

    If you could post more details information, it will be more easily for us to find out the reason.

    Best Regards,

    Brando

    Tuesday, January 1, 2019 6:04 AM
  • User246635104 posted

    I managed to resolve it by configuring my LoggerFactory earlier on in Startup.cs under Configure() and making a LogInformation call directly <g class="gr_ gr_496 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="496" data-gr-id="496">afterwards</g>.

    I used to have the loggerFactory configured when my first ILogger call was made later on.
    But this didn't work anymore after I updated the site extension.

    Thanks for the assistance.


    Wednesday, January 2, 2019 7:11 AM