I don't fully understand the format of log-file. And how about add JSON-formatted log files?

Asked by Chaser-andrey

What the magic numbers in the log files?
NOTICE 1
WARNING 1
WARNING 5
INFO 3

I can't found any docs about structure of log files. :-(

Also, what about adding optional support for JSON format of log files? I see in documentation, that log files "designed to be easily consumable by other programs." I think that JSON format will be much better and easily, because there are many light and fast JSON parsers for different languages.

I'm not a Python developer, but I think, I'll might write patch if upstream will support this idea.

Question information

Language:
English Edit question
Status:
Answered
For:
Duplicity Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
edso (ed.so) said :
#1

On 15.01.2013 23:01, Chaser-andrey wrote:
> New question #219277 on Duplicity:
> https://answers.launchpad.net/duplicity/+question/219277
>
> What the magic numbers in the log files?
> NOTICE 1
> WARNING 1
> WARNING 5
> INFO 3

which magic numbers? generally there are several log levels, see manpage.

> I can't found any docs about structure of log files. :-(

there are two kinds of log output.

1. the user interpretable (default), which is generally a text about what is going on with a note about the severance (log level)

2. --log-file <filename>, --log-fd <number> enable additional simplified output .. pretty much like the above but formatted for easier parsing. unfortunately there is no specific documentation about it, but try it and compare it to the default out and you'll understand.

> Also, what about adding optional support for JSON format of log files? I see in documentation, that log files "designed to be easily consumable by other programs." I think that JSON format will be much better and easily, because there are many light and fast JSON parsers for different languages.

that's not an option for light weight backends like the bash based shell one duply i am maintaining. so yes, as an addition, no as a replacement.

> I'm not a Python developer, but I think, I'll might write patch if upstream will support this idea.
>
>

you are welcome to do so, i suggest you to add a --log-format [plain,json] switch, plain being the default value.

..ede/duply.net

Revision history for this message
evilmonkey (evilmonkey) said :
#2

So, figuring out the log lines this is what I've come up with (at least for the "NOTICE 16" lines which seem to correlate with your progress (may need the --progress flag)

| log level and type | total transferred (b) | duration (s) | % complete | ETA (s) | transfer rate (b/s) | Num Errors |

so, this log line:
NOTICE 16 3109632428 2435 9 22515 1297117 0

means:
2.9GB of data has been sent in 00:40:35 and you are currently at 9%. It will take approximately 6h 15m to complete at the current rate of 1.2MB/s. No errors have been recorded.

Can you help with this problem?

Provide an answer of your own, or ask Chaser-andrey for more information if necessary.

To post a message you must log in.