locked
Cannot Get Logging Enabled For iisnode App Deployed To Azure RRS feed

  • Question

  • I am unable to get logging to work for a node application I am deploying to Windows Azure. I am overriding the web.config with the iisnode.yml file option.

    Here's the yml file contents:

    node_env: development
    nodeProcessCountPerApplication
    : 1
    maxConcurrentRequestsPerProcess
    : 1024
    maxNamedPipeConnectionRetry
    : 24
    namedPipeConnectionRetryDelay
    : 250
    maxNamedPipeConnectionPoolSize
    : 512
    maxNamedPipePooledConnectionAge
    : 30000
    asyncCompletionThreadCount
    : 0
    initialRequestBufferSize
    : 4096
    maxRequestBufferSize
    : 65536
    watchedFiles
    : *.js;iisnode.yml
    uncFileChangesPollingInterval
    : 5000
    gracefulShutdownTimeout
    : 60000
    loggingEnabled
    : true
    logDirectory
    : iisnode
    debuggingEnabled
    : true
    debuggerPortRange
    : 5058-6058
    debuggerPathSegment
    : debug
    maxLogFileSizeInKB
    : 128
    maxTotalLogFileSizeInKB
    : 1024
    maxLogFiles
    : 20
    devErrorsEnabled
    : true
    flushResponse
    : false
    enableXFF
    : false

    Here's the contents of the web.config file that's being overriden:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
       
    <system.webServer>
           
    <modules runAllManagedModulesForAllRequests="false" />
           
    <iisnode configOverrides="iisnode.yml" debuggingEnabled="true" loggingEnabled="true" logDirectory="iisnode" devErrorsEnabled="true" nodeProcessCommandLine="&quot;%programfiles(x86)%\nodejs\node.exe&quot;"  />
           
    <handlers>
               
    <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
           
    </handlers>
            <rewrite>
                <rules>
                    <clear /
    >
                   
    <rule name="app" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
                       
    <match url="server\.js.+" negate="true" />
                       
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                       
    <action type="Rewrite" url="server.js" />
                   
    </rule>
                    <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
                        <match url="iisnode"/
    >
                   
    </rule>
                    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
                        <match url="^server.js\/debug[\/]?" /
    >
                   
    </rule>
                    <rule name="StaticContent">
                        <action type="Rewrite" url="public{{REQUEST_URI}}"/
    >
                   
    </rule>
                    <rule name="DynamicContent">
                        <conditions>
                            <add input="{{REQUEST_FILENAME}}" matchType="IsFile" negate="True"/
    >
                       
    </conditions>
                        <action type="Rewrite" url="server.js"/
    >
                   
    </rule>
                </
    rules>
           
    </rewrite>
        </
    system.webServer>
    </configuration>

    I'm pretty sure I have enabled every logging option I can in both, but neither seems to be picked up by Azure during deployment and when I access the typical logging location,http://mysite.com/iisnode/index.html or http://mysite.com/iisnode/ I receive a 404 error.

    Any help or ideas would be appreciated.

    Tuesday, September 18, 2012 8:14 PM

Answers

All replies

    • Marked as answer by Jiang Yun Tuesday, September 25, 2012 10:22 AM
    Thursday, September 20, 2012 5:20 AM
  • Are you deploying to a Web Role or Windows Azure Web Sites?

    In case of Windows Azure Web Sites, you should not be overriding the `logDirectory` setting. Windows Azure Web Sites already customizes it for you such that you can download log files from the portal using FTP. Access to node.js log files through HTTP is not possible in Windows Azure Web Sites. 

    Thursday, September 20, 2012 5:31 PM
  • We're deploying to a web role via the publish-azureserviceproject cmdlet.
    Friday, September 28, 2012 7:04 PM
  • I read both of the linked articles in that forum topic before trying the iisnode.yml file approach. I wasn't able to pinpoint anything that is wrong in the config files I posted based on the information in the articles.
    Friday, September 28, 2012 7:08 PM