Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
d13085ac
Commit
d13085ac
authored
Mar 29, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sentry.io logger option
parent
4dd79170
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
3 deletions
+31
-3
CHANGELOG.md
CHANGELOG.md
+2
-1
config.sample.yml
config.sample.yml
+1
-0
logger.js
libs/logger.js
+8
-0
sentry.js
libs/winston-transports/sentry.js
+20
-0
server.js
server.js
+0
-2
No files found.
CHANGELOG.md
View file @
d13085ac
...
...
@@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
-
Interactive setup
-
Auth: GitHub and Slack authentication providers are now available
-
Auth: LDAP authentication provider is now available
-
Logs: Support for the logging services: Bugsnag, Loggly, Papertrail
and Rollbar
-
Logs: Support for the logging services: Bugsnag, Loggly, Papertrail
, Rollbar and Sentry
### Changed
-
Native Compilation Removal: Replaced farmhash with md5
...
...
@@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
-
Sidebar: Contents is now Page Contents
-
Sidebar: Start is now Top of Page
-
UI: Content headers are now showing an anchor icon instead of a #
-
Dev: Replaced Gulp with Fuse-box
### Fixed
-
Auth: Authentication would fail if email has uppercase chars and provider callback is in lowercase
...
...
config.sample.yml
View file @
d13085ac
...
...
@@ -141,4 +141,5 @@ externalLogging:
loggly
:
false
papertrail
:
false
rollbar
:
false
sentry
:
false
libs/logger.js
View file @
d13085ac
...
...
@@ -60,5 +60,13 @@ module.exports = (isDebug) => {
})
}
if
(
appconfig
.
externalLogging
.
sentry
)
{
const
sentryTransport
=
require
(
'./winston-transports/sentry'
)
winston
.
add
(
sentryTransport
,
{
level
:
'warn'
,
key
:
appconfig
.
externalLogging
.
sentry
})
}
return
winston
}
libs/winston-transports/sentry.js
0 → 100644
View file @
d13085ac
'use strict'
const
util
=
require
(
'util'
)
const
winston
=
require
(
'winston'
)
let
SentryLogger
=
winston
.
transports
.
RollbarLogger
=
function
(
options
)
{
this
.
name
=
'sentryLogger'
this
.
level
=
options
.
level
||
'warn'
this
.
raven
=
require
(
'raven'
)
this
.
raven
.
config
(
options
.
key
).
install
()
}
util
.
inherits
(
SentryLogger
,
winston
.
Transport
)
SentryLogger
.
prototype
.
log
=
function
(
level
,
msg
,
meta
,
callback
)
{
level
=
(
level
===
'warn'
)
?
'warning'
:
level
this
.
raven
.
captureMessage
(
msg
,
{
level
,
extra
:
meta
})
callback
(
null
,
true
)
}
module
.
exports
=
SentryLogger
server.js
View file @
d13085ac
...
...
@@ -212,8 +212,6 @@ server.on('error', (error) => {
server
.
on
(
'listening'
,
()
=>
{
winston
.
info
(
'[SERVER] HTTP/WS server started successfully! [RUNNING]'
)
winston
.
warn
(
'Something went wrong!'
)
winston
.
error
(
'An big error occured!'
)
})
// ----------------------------------------
...
...
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