Verified Commit 197f031c authored by les's avatar les
Browse files

log_path / log_level configuration

parent 9a864ec2
......@@ -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')
......
......@@ -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 <CONFIG_FILE.json>' `)
}
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')
}
......
......@@ -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))
......
......@@ -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,
......
Supports Markdown
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