Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
08593360
authored
Dec 21, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on more informative log files
parent
5a37ba0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
sails/src/config/log.js
sails/src/config/routes.js
sails/src/config/log.js
View file @
08593360
...
...
@@ -55,6 +55,19 @@ customLogger.add(winston.transports.File, {
filename
:
path
.
resolve
(
__dirname
,
'../..'
,
'logs'
,
'error.json'
)
});
customLogger
.
add
(
winston
.
transports
.
File
,
{
name
:
'error-json'
,
silent
:
false
,
colorize
:
false
,
level
:
'info'
,
showLevel
:
true
,
timestamp
:
true
,
json
:
true
,
tailable
:
true
,
maxsize
:
5
*
1024
*
1024
,
// 5 MegaByte
filename
:
path
.
resolve
(
__dirname
,
'../..'
,
'logs'
,
'info.json'
)
});
module
.
exports
.
log
=
{
level
:
'silly'
,
inspect
:
false
,
...
...
sails/src/config/routes.js
View file @
08593360
...
...
@@ -20,6 +20,13 @@
* http://sailsjs.org/#/documentation/concepts/Routes/RouteTargetSyntax.html
*/
module
.
exports
.
routes
=
{
// This is to log to info every access
'/*'
:
function
(
req
,
res
,
next
)
{
sails
.
log
.
info
(
req
.
method
,
req
.
url
,
req
.
allParams
());
next
();
},
// Grouped by API url (/a, /b, ...)
// Sorted by HTTP method (GET, PUT, POST and DELETE)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment