Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
fce9ecb9
Commit
fce9ecb9
authored
Aug 09, 2002
by
Michael Smith
Browse files
Allow setting the log level (for the error log, not the access log) from the
config file. svn path=/trunk/icecast/; revision=3774
parent
8d75eb0b
Changes
4
Hide whitespace changes
Inline
Side-by-side
conf/icecast.xml
View file @
fce9ecb9
...
...
@@ -38,6 +38,7 @@
<logging>
<accesslog>
access.log
</accesslog>
<errorlog>
error.log
</errorlog>
<loglevel>
4
</loglevel>
<!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
</logging>
<security>
...
...
src/config.c
View file @
fce9ecb9
...
...
@@ -19,6 +19,7 @@
#define CONFIG_DEFAULT_PORT 8888
#define CONFIG_DEFAULT_ACCESS_LOG "access.log"
#define CONFIG_DEFAULT_ERROR_LOG "error.log"
#define CONFIG_DEFAULT_LOG_LEVEL 4
#define CONFIG_DEFAULT_CHROOT 0
#define CONFIG_DEFAULT_CHUID 0
#define CONFIG_DEFAULT_USER NULL
...
...
@@ -151,6 +152,7 @@ static void _set_defaults(void)
_configuration
.
log_dir
=
(
char
*
)
strdup
(
CONFIG_DEFAULT_LOG_DIR
);
_configuration
.
access_log
=
(
char
*
)
strdup
(
CONFIG_DEFAULT_ACCESS_LOG
);
_configuration
.
error_log
=
(
char
*
)
strdup
(
CONFIG_DEFAULT_ERROR_LOG
);
_configuration
.
loglevel
=
CONFIG_DEFAULT_LOG_LEVEL
;
_configuration
.
chroot
=
CONFIG_DEFAULT_CHROOT
;
_configuration
.
chuid
=
CONFIG_DEFAULT_CHUID
;
_configuration
.
user
=
CONFIG_DEFAULT_USER
;
...
...
@@ -299,7 +301,11 @@ static void _parse_logging(xmlDocPtr doc, xmlNodePtr node)
}
else
if
(
strcmp
(
node
->
name
,
"errorlog"
)
==
0
)
{
if
(
_configuration
.
error_log
)
free
(
_configuration
.
error_log
);
_configuration
.
error_log
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
}
}
else
if
(
strcmp
(
node
->
name
,
"loglevel"
)
==
0
)
{
char
*
tmp
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
_configuration
.
loglevel
=
atoi
(
tmp
);
if
(
tmp
)
free
(
tmp
);
}
}
while
((
node
=
node
->
next
));
}
...
...
src/config.h
View file @
fce9ecb9
...
...
@@ -43,6 +43,7 @@ typedef struct ice_config_tag
char
*
access_log
;
char
*
error_log
;
int
loglevel
;
int
chroot
;
int
chuid
;
...
...
src/main.c
View file @
fce9ecb9
...
...
@@ -107,7 +107,7 @@ static int _start_logging(void)
accesslog
=
log_open_file
(
stderr
);
}
log_set_level
(
errorlog
,
4
);
log_set_level
(
errorlog
,
config
->
loglevel
);
log_set_level
(
accesslog
,
4
);
if
(
errorlog
<
0
)
...
...
Write
Preview
Supports
Markdown
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