diff --git a/pages/index.vue b/pages/index.vue index 4b1ebc67..54ae87ac 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -18,7 +18,7 @@ v-chip(v-if='selectedDay' close @click:close='dayChange({ date: selectedDay})') {{selectedDay}} //- Events - #events.mb-2.mt-1.pl-1.pl-md-0 + #events.mb-2.mt-1.pl-1.pl-sm-2 //- div.event(v-for='(event, idx) in events' :key='event.id' v-intersect="(entries, observer, isIntersecting) => intersecting[event.id] = isIntersecting") Event(:event='event' v-for='(event, idx) in visibleEvents' :key='event.id' @tagclick='tagClick' @placeclick='placeClick') diff --git a/server/cli.js b/server/cli.js index be067330..9fdb9735 100755 --- a/server/cli.js +++ b/server/cli.js @@ -162,6 +162,12 @@ async function setupQuestionnaire (is_docker, db) { validate: notEmpty }) + questions.push({ + name: 'log_path', + message: 'Log path', + default: '/opt/gancio/logs' + }) + questions.push({ name: 'smtp_type', message: 'How should we send the emails ?', @@ -228,6 +234,8 @@ async function setupQuestionnaire (is_docker, db) { if (is_docker) { answers.server = { host: '0.0.0.0', port: 13120 } answers.upload_path = '/opt/gancio/uploads' + answers.log_level = 'debug' + answers.log_path = '/opt/gancio/logs' if (db === 'sqlite') { answers.db = { dialect: db, storage: '/opt/gancio/db.sqlite' } } else { @@ -282,7 +290,7 @@ If this is your first run use 'gancio setup --config ' `) } const config = require('config') await run_migrations(config.db) - consola.info(`Logging to ${path.resolve('./logs/gancio.log')} [level: ${config.loglevel}]`) + consola.info(`Logging to ${path.resolve(`${config.log_path}/gancio.log`)} [level: ${config.log_level}]`) require('./index') } diff --git a/server/firstrun.js b/server/firstrun.js index 8e1220da..d4924e32 100644 --- a/server/firstrun.js +++ b/server/firstrun.js @@ -27,6 +27,8 @@ module.exports = { delete config.smtp_need_auth config.admin_email = admin.email config.db.logging = false + config.log_level = 'debug' + config.log_path = '/opt/gancio/logs' consola.info(`Save configuration to ${config_path}`) try { fs.writeFileSync(config_path, JSON.stringify(config, null, 2)) diff --git a/server/log.js b/server/log.js index 26e47a38..3a490656 100644 --- a/server/log.js +++ b/server/log.js @@ -21,8 +21,8 @@ const logger = createLogger({ : [new DailyRotateFile({ handleExceptions: true, handleRejections: true, - level: config.loglevel || 'info', - filename: './logs/gancio.%DATE%.log', + level: config.log_level || 'info', + filename: config.log_path + '/gancio.%DATE%.log', symlinkName: 'gancio.log', createSymlink: true, zippedArchive: true,