Commit 76aee8fe authored by yPhil's avatar yPhil
Browse files

Logging to ~/.pm2/logs/petrolette-*.log OK, format OK, goaccess format COMBINED OK

parent 4085c2ac
......@@ -3,13 +3,18 @@ const express = require('express'),
index = require('./routes/index'),
fs = require('fs'),
pjson = require('./package.json'),
bodyParser = require('body-parser'),
app = express(),
bodyParser = require('body-parser');
morgan = require('morgan');
if (!fs.existsSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR))){
fs.mkdirSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR));
}
app.use(morgan('combined'));
// morgan.format('combined', ':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"')
app.set('views', path.join(__dirname, 'views'));
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
......
......@@ -17,8 +17,8 @@ function isLocal() {
}
}
console.log('### ENV: ' + process.env.NODE_ENV);
console.log('## PORT: ' + port);
// console.log('### ENV: ' + process.env.NODE_ENV);
// console.log('## PORT: ' + port);
// if (!isLocal) {
......
This diff is collapsed.
......@@ -29,8 +29,8 @@
"favrat": "git+https://framagit.org/yphil/favrat.git",
"feedparser": "^2.2.10",
"feedrat": "git+https://framagit.org/yphil/feedrat.git",
"gitlab-runner": "0.0.10",
"iconv": "^3.0.0",
"morgan": "^1.10.0",
"npm": "^7.5.2",
"pm2": "^4.5.4",
"request": "latest"
......
......@@ -5,7 +5,7 @@
"script" : "./bin/www",
"watch" : true,
"ignore_watch" : ["#*", "favicons-cache", ".git", "node_modules"],
"log_date_format" : "YYYY-MM-DD HH:mm",
"time" : false,
"env" : {
"PORT" : 8000,
"NODE_ENV": "dev"
......
......@@ -14,7 +14,7 @@ const express = require('express'),
require('events').EventEmitter.defaultMaxListeners = 15;
console.log('####### START ## Version (%s)', pjson.version);
// console.log('####### START ## Version (%s)', pjson.version);
process.on('uncaughtException', function(err) {
console.log('### uncaughtException (%s) : ', err);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment