From the policykit documentation:
The log()
method writes the given message to the system logger
prefixed with the JavaScript filename and line number. Log entries are
emitted using the LOG_AUTHPRIV
flag meaning that the log entries
usually ends up in the file /var/log/secure
. The log()
method is
usually only used when debugging rules. The Action and Subject types
has suitable toString()
methods defined for easy logging, for
example,
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.policykit.exec") {
polkit.log("action=" + action);
polkit.log("subject=" + subject);
}
});
will produce the following when the user runs pkexec -u bateman bash -i
from a shell:
May 24 14:28:50 thinkpad polkitd[32217]: /etc/polkit-1/rules.d/10-test.rules:3: action=[Action id='org.freedesktop.policykit.exec' command_line='/usr/bin/bash -i' program='/usr/bin/bash' user='bateman' user.gecos='Patrick Bateman' user.display='Patrick Bateman (bateman)']
May 24 14:28:50 thinkpad polkitd[32217]: /etc/polkit-1/rules.d/10-test.rules:4: subject=[Subject pid=1352 user='davidz' groups=davidz,wheel, seat='seat0' session='1' local=true active=true]
This type of log events is usually found in /var/log/auth.log
in Debian and its derivatives including Ubuntu.
Source: /var/log/secure not present in 14.04 ,is there any alternative?