Page MenuHome GnuPG

--log-file usage problem with gpg
Closed, ResolvedPublic

Description

It seems that --log-file option does not work with gpg on some circumstances.

Observation:

Command line on Windows 10 with Gpg4win 3.1.10:

echo hi > "C:\Users\intevation\testlog.txt"
C:\Users\intevation>type testlog.txt
hi
gpg -vv --debug-all --log-file "C:\Users\intevation\testlog.txt"
^Z
rem does not work

also on Debian GNU/Linux 9:

gpg --log-file /home/ber/testlog.txt -vv --debug-all -k
# does not work
gpg --version
gpg (GnuPG) 2.2.13

The documentation lists --log-file,e.g. https://gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html#GPG-Esoteric-Options
and there is no error message.

(Maybe I'm missing something here, tried it to answer https://wald.intevation.org/forum/forum.php?thread_id=2122&forum_id=21&group_id=11

Event Timeline

Here is my understanding:
--log-file option is valid for for background task like gpg-agent, dirmngr and scdaemon.
For gpg, it only works with --batch or --server.

You may want to use a recent version of GnuPG ;-)

You need to add --batch to use --log-file. This is required to avoid regression with some scripts. I very recently lifted that restriction from master (to be 2.3).

Thanks for your comments. It would have been cool if this restriction would have been noted
in the gpg options documentation. (Where is was missing at least where I was looking.)

Okay, maybe this should just be added to the 2.2.x docs.

werner claimed this task.

Done. Thanks.