Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
2b707bff
Commit
2b707bff
authored
Feb 14, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use ImmutableString for log file
parent
9055323b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
src/shrpx.cc
src/shrpx.cc
+2
-2
src/shrpx_config.cc
src/shrpx_config.cc
+2
-2
src/shrpx_config.h
src/shrpx_config.h
+2
-2
src/shrpx_log.cc
src/shrpx_log.cc
+7
-7
No files found.
src/shrpx.cc
View file @
2b707bff
...
...
@@ -1121,7 +1121,7 @@ void fill_default_config() {
accessconf
.
format
=
parse_log_format
(
DEFAULT_ACCESSLOG_FORMAT
);
auto
&
errorconf
=
loggingconf
.
error
;
errorconf
.
file
=
strcopy
(
"/dev/stderr"
)
;
errorconf
.
file
=
"/dev/stderr"
;
}
loggingconf
.
syslog_facility
=
LOG_DAEMON
;
...
...
@@ -1752,7 +1752,7 @@ Logging:
Set path to write error log. To reopen file, send USR1
signal to nghttpx. stderr will be redirected to the
error log file unless --errorlog-syslog is used.
Default: )"
<<
get_config
()
->
logging
.
error
.
file
.
get
()
<<
R"(
Default: )"
<<
get_config
()
->
logging
.
error
.
file
<<
R"(
--errorlog-syslog
Send error log to syslog. If this option is used,
--errorlog-file option is ignored.
...
...
src/shrpx_config.cc
View file @
2b707bff
...
...
@@ -1622,7 +1622,7 @@ int parse_config(const char *opt, const char *optarg,
return
parse_duration
(
&
mod_config
()
->
http2
.
timeout
.
stream_write
,
opt
,
optarg
);
case
SHRPX_OPTID_ACCESSLOG_FILE
:
mod_config
()
->
logging
.
access
.
file
=
strcopy
(
optarg
)
;
mod_config
()
->
logging
.
access
.
file
=
optarg
;
return
0
;
case
SHRPX_OPTID_ACCESSLOG_SYSLOG
:
...
...
@@ -1634,7 +1634,7 @@ int parse_config(const char *opt, const char *optarg,
return
0
;
case
SHRPX_OPTID_ERRORLOG_FILE
:
mod_config
()
->
logging
.
error
.
file
=
strcopy
(
optarg
)
;
mod_config
()
->
logging
.
error
.
file
=
optarg
;
return
0
;
case
SHRPX_OPTID_ERRORLOG_SYSLOG
:
...
...
src/shrpx_config.h
View file @
2b707bff
...
...
@@ -504,12 +504,12 @@ struct Http2Config {
struct
LoggingConfig
{
struct
{
std
::
vector
<
LogFragment
>
format
;
std
::
unique_ptr
<
char
[]
>
file
;
ImmutableString
file
;
// Send accesslog to syslog, ignoring accesslog_file.
bool
syslog
;
}
access
;
struct
{
std
::
unique_ptr
<
char
[]
>
file
;
ImmutableString
file
;
// Send errorlog to syslog, ignoring errorlog_file.
bool
syslog
;
}
error
;
...
...
src/shrpx_log.cc
View file @
2b707bff
...
...
@@ -393,23 +393,23 @@ int reopen_log_files() {
auto
&
accessconf
=
get_config
()
->
logging
.
access
;
auto
&
errorconf
=
get_config
()
->
logging
.
error
;
if
(
!
accessconf
.
syslog
&&
accessconf
.
file
)
{
new_accesslog_fd
=
util
::
open_log_file
(
accessconf
.
file
.
get
());
if
(
!
accessconf
.
syslog
&&
!
accessconf
.
file
.
empty
()
)
{
new_accesslog_fd
=
util
::
open_log_file
(
accessconf
.
file
.
c_str
());
if
(
new_accesslog_fd
==
-
1
)
{
LOG
(
ERROR
)
<<
"Failed to open accesslog file "
<<
accessconf
.
file
.
get
()
;
LOG
(
ERROR
)
<<
"Failed to open accesslog file "
<<
accessconf
.
file
;
res
=
-
1
;
}
}
if
(
!
errorconf
.
syslog
&&
errorconf
.
file
)
{
new_errorlog_fd
=
util
::
open_log_file
(
errorconf
.
file
.
get
());
if
(
!
errorconf
.
syslog
&&
!
errorconf
.
file
.
empty
()
)
{
new_errorlog_fd
=
util
::
open_log_file
(
errorconf
.
file
.
c_str
());
if
(
new_errorlog_fd
==
-
1
)
{
if
(
lgconf
->
errorlog_fd
!=
-
1
)
{
LOG
(
ERROR
)
<<
"Failed to open errorlog file "
<<
errorconf
.
file
.
get
()
;
LOG
(
ERROR
)
<<
"Failed to open errorlog file "
<<
errorconf
.
file
;
}
else
{
std
::
cerr
<<
"Failed to open errorlog file "
<<
errorconf
.
file
.
get
()
std
::
cerr
<<
"Failed to open errorlog file "
<<
errorconf
.
file
<<
std
::
endl
;
}
...
...
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