1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +03:00

journal-remote: improve some messages

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-07-01 23:18:44 -04:00
parent 4a0a6ac038
commit a83f403760
4 changed files with 15 additions and 13 deletions

View File

@ -203,7 +203,7 @@ static int get_data_size(RemoteSource *source) {
source->data_size = le64toh( *(uint64_t *) data );
if (source->data_size > DATA_SIZE_MAX) {
log_error("Stream declares field with size %zu > %u == DATA_SIZE_MAX",
log_error("Stream declares field with size %zu > DATA_SIZE_MAX = %u",
source->data_size, DATA_SIZE_MAX);
return -EINVAL;
}
@ -429,8 +429,8 @@ int process_source(RemoteSource *source, Writer *writer, bool compress, bool sea
return r;
/* We have a full event */
log_info("Received a full event from source@%p fd:%d (%s)",
source, source->fd, source->name);
log_debug("Received a full event from source@%p fd:%d (%s)",
source, source->fd, source->name);
if (!source->iovw.count) {
log_warning("Entry with no payload, skipping");

View File

@ -114,10 +114,12 @@ int writer_write(Writer *s,
if (r >= 0)
return 1;
log_info("%s: Write failed, rotating", s->journal->path);
log_debug("%s: Write failed, rotating: %s", s->journal->path, strerror(-r));
r = do_rotate(&s->journal, compress, seal);
if (r < 0)
return r;
else
log_info("%s: Successfully rotated journal", s->journal->path);
log_debug("Retrying write.");
r = journal_file_append_entry(s->journal, ts, iovw->iovec, iovw->count,

View File

@ -500,8 +500,8 @@ static int process_http_upload(
r = get_writer(server, source->name, NULL, &w);
if (r < 0) {
log_warning("Failed to get writer for source %s (%s): %s",
source->name, source->name, strerror(-r));
log_warning("Failed to get writer for source %s: %s",
source->name, strerror(-r));
return mhd_respondf(connection,
MHD_HTTP_SERVICE_UNAVAILABLE,
"Failed to get writer for connection: %s.\n",
@ -509,7 +509,7 @@ static int process_http_upload(
}
if (*upload_data_size) {
log_info("Received %zu bytes", *upload_data_size);
log_debug("Received %zu bytes", *upload_data_size);
r = push_data(source, upload_data, *upload_data_size);
if (r < 0)
@ -951,7 +951,7 @@ static int remoteserver_init(RemoteServer *s,
STRV_FOREACH(file, arg_files) {
if (streq(*file, "-")) {
log_info("Reading standard input...");
log_info("Using standard input as source.");
fd = STDIN_FILENO;
output_name = "stdin";
@ -1061,8 +1061,8 @@ static int dispatch_raw_source_event(sd_event_source *event,
r = get_writer(s, source->name, NULL, &w);
if (r < 0) {
log_warning("Failed to get writer for source %s (%s): %s",
source->name, source->name, strerror(-r));
log_warning("Failed to get writer for source %s: %s",
source->name, strerror(-r));
return r;
}
@ -1077,7 +1077,7 @@ static int dispatch_raw_source_event(sd_event_source *event,
if (remaining > 0)
log_warning("Premature EOF. %zu bytes lost.", remaining);
remove_source(s, source->fd);
log_info("%zd active source remaining", s->active);
log_info("%zd active sources remaining", s->active);
return 0;
} else if (r == -E2BIG) {
log_error("Entry too big, skipped");
@ -1195,7 +1195,7 @@ static int parse_config(void) {
static void help(void) {
printf("%s [OPTIONS...] {FILE|-}...\n\n"
"Write external journal events to a journal file.\n\n"
"Write external journal events to journal file(s).\n\n"
"Options:\n"
" --url=URL Read events from systemd-journal-gatewayd at URL\n"
" --getter=COMMAND Read events from the output of COMMAND\n"

View File

@ -479,7 +479,7 @@ static void help(void) {
printf("%s -u URL {FILE|-}...\n\n"
"Upload journal events to a remote server.\n\n"
"Options:\n"
" --url=URL Upload to this address\n"
" -u --url=URL Upload to this address\n"
" --key=FILENAME Specify key in PEM format\n"
" --cert=FILENAME Specify certificate in PEM format\n"
" --trust=FILENAME Specify CA certificate in PEM format\n"