2017-07-19 155 views
0

一切都建立正常启用日志记录,但由于池的书面许可的任何地方创建无IISnode /或记录/文件夹,:变化湛蓝的游泳池权限

我得到这个错误讯息每次我试图访问时间我在浏览应用程序:

enter image description here

为了看日志,我有授权应用游泳池写入日志文件。

但我找不出在Azure门户中编辑权限的位置。

我已经打开了日志记录:

enter image description here

这里是我的IISNode.yml文件:

node_env: production 

loggingEnabled: true 
devErrorsEnabled: true 
logDirectory: iisnode 
debuggingEnabled: true 
maxLogFileSizeInKB: 1048 
maxLogFiles: 50 

在哪儿?

我没有日志很坚持,因为我想不通,为什么不能我的应用程序启动

编辑:

更多细节:

节点版本:7.10 .0

项目结构

gdpr/ 
    web.config 
    package.json  
    node_modules/ 
    app/ 
     sslCert.pem 
     server.js 
     app.js 
     config.js 
     routes.js 
     knexfile.js 
     migrations/ 
     api/ 
      controller.js 
      handlers/ 
       {...several *.js} 

起始点:server.js

config.js

var fs = require('fs'); 
var config = module.exports; 
var PRODUCTION = process.env.NODE_ENV === 'production'; 

config.express = { 
    port: process.env.EXPRESS_PORT || 51082, 
    ip: '127.0.0.1' 
}; 

config.knex = require('knex')({ 
    client: 'mysql', 
    connection: { 
     host: 'someHost.mysql.database.azure.com', 
     user: '[email protected]', 
     password: 'somePw', 
     database: 'gdpr', 
     insecureAuth: true 
    }, 
    debug: ['ComQueryPacket'], 
    pool: { 
     min: 0 
    } 
}); 


config.migrate = function(cb){ 
    config.knex.migrate.latest() 
     .then(function() { 
      cb(); 
     }); 
} 


config.bookshelf = require('bookshelf')(config.knex); 


if (PRODUCTION) { 
    //for example 
    config.express.ip = '0.0.0.0'; 
} 

server.js

var app = require('./app'); 
var config = require('./config'); 


function launchApp() { 
    app.listen(config.express.port, config.express.ip, function (err) { 
     if (err) { 
      console.log('Unable to listen for connections'); 
      console.log(err); 
      process.exit(10); 
     } 
     console.log('express is listening on http://' + config.express.ip + ':' + config.express.port); 
    }); 
} 

config.migrate(launchApp); 

的web.config:通过捻D:\home\site\wwwroot\iisnode或将浏览到它:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.webServer>   
     <webSocket enabled="false" /> 

     <handlers> 
      <add name="iisnode" path="app/server.js" verb="*" modules="iisnode" /> 
     </handlers> 

     <rewrite> 
      <rules> 
       <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"> 
        <match url="^app/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="app/server.js" /> 
       </rule> 
      </rules> 
     </rewrite> 

     <security> 
      <requestFiltering> 
       <hiddenSegments> 
        <remove segment="bin" /> 
       </hiddenSegments> 
      </requestFiltering> 
     </security> 

     <httpErrors existingResponse="PassThrough" /> 

     <iisnode 
      watchedFiles="web.config;*.js" 
      node_env="%node_env%" 
      loggingEnabled="true" 
      logDirectory="iisnode" 
      debuggingEnabled="true" 
      maxLogFileSizeInKB="1048" 
      maxLogFiles="50" 
      devErrorsEnabled="true" /> 
    </system.webServer> 
</configuration> 

回答

0

当你启用标准错误和标准输出的记录从你的Node.js应用程序,你可以检查出日志

https://<yoursitename>.scm.azurewebsites.net/api/vfs/site/wwwroot/iisnode/index.html 
+0

没有,这是我的问题。这个池没有写日志文件的权限,就像我在我的帖子中写的那样。所以即使参数打开,也没有创建文件夹。通过输入你的url,我得到{“Message”:''D:\\ home \\ site \\ wwwroot \\ iisnode \\ index.html'找不到。“} –

+0

你可以把'web.config'文件从[这篇文章](https://stackoverflow.com/questions/45193863/permissions-and-request-with-iisnode/45208082#45208082)并将其放入'/ wwwroot'文件夹? –

+0

不管怎样,完成但仍然是同样的问题。该端口已被设置为默认env。 –

相关问题