Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
forks
lager
Commits
75a50886
Commit
75a50886
authored
13 years ago
by
Andrew Thompson
Browse files
Options
Download
Email Patches
Plain Diff
Make the file backend clean up on terminate
parent
0791fdfb
master
1.2
2.x
basho/fix-async_threshold_test
basho/separate-test-directory
borshop-integration-312-close-file-after-timebased-rotation
borshop-integration-334-issue-332
borshop-integration-335-issue-329
borshop-integration-339-gh334-2x
bugfix/improper-io-list-support
bugfix_jrd_watcher-test
develop-2.2
enable_thumbs
end-to-end/timeseries
feature/rebar3
feature/riak-2903/rebar3
fix_18_tests
fix_otp15_undef
gh286
gh287
gh291
gh334-2x
gh337-2x
killer_poll
mra/gh315
r19-jrd-typed_records
rebar3
upstream-master
3.9.2
3.9.1
3.9.0
3.8.2
3.8.1
3.8.0
3.7.0
3.6.10
3.6.9
3.6.8
3.6.7
3.6.6
3.6.5
3.6.4
3.6.3
3.6.2
3.6.1
3.6.0
3.5.2
3.5.1
3.5.0
3.4.2
3.4.1
3.4.0
3.3.0
3.2.4
3.2.3
3.2.2
3.2.1
3.2.0
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
3.0.0-RC2
3.0.0-RC1
2.2.3
2.2.2
2.2.1
2.2.0
2.1.1
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
2.0.0rc2
2.0.0rc1
1.2.2
1.2.1
1.2.0
1.0.0
0.9.4
0.9.3
0.9.2
0.9.1
oktell/3.2.4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lager.erl
+3
-1
src/lager.erl
src/lager_file_backend.erl
+7
-2
src/lager_file_backend.erl
with
10 additions
and
3 deletions
+10
-3
src/lager.erl
View file @
75a50886
...
...
@@ -33,7 +33,8 @@ start_link() ->
%application:start(riak_err),
Handlers
=
case
application
:
get_env
(
lager
,
handlers
)
of
undefined
->
[{
lager_console_backend
,
[
info
]}];
[{
lager_console_backend
,
[
info
]},
{
lager_file_backend
,
[{
"error.log"
,
error
},
{
"console.log"
,
info
}]}];
Val
->
Val
end
,
...
...
@@ -91,6 +92,7 @@ handle_info(Info, State) ->
{
noreply
,
State
}.
terminate
(_
Reason
,
_
State
)
->
gen_event
:
stop
(
lager_event
),
ok
.
code_change
(_
OldVsn
,
State
,
_
Extra
)
->
...
...
This diff is collapsed.
Click to expand it.
src/lager_file_backend.erl
View file @
75a50886
...
...
@@ -67,8 +67,13 @@ handle_event(_Event, State) ->
handle_info
(_
Info
,
State
)
->
{
ok
,
State
}.
terminate
(_
Reason
,
_
State
)
->
ok
.
terminate
(_
Reason
,
State
)
->
io
:
format
(
"lager file handler exiting
~n
"
),
%% flush and close any file handles
lists
:
foreach
(
fun
({_,
_,
FD
,
_})
->
file
:
datasync
(
FD
),
file
:
close
(
FD
);
(_)
->
ok
end
,
State
#state.files
).
code_change
(_
OldVsn
,
State
,
_
Extra
)
->
{
ok
,
State
}.
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help