Open hendrikbl opened 4 weeks ago
Having this functionality for script logs would also be nice. Currently the same logging functions are used in the run
function as well as the test_
functions. But when called from inside the run
function, the second parameter (which is the object) is never displayed in the logs on the front end. There is simply no column to display the value.
I think in an effort to merge scripts and reports it would be nice to also get some consistency there.
More generally, it seems that the logging functions for scripts (syntax log_info(message, obj)
) ignore the obj
argument in NetBox 4.0, despite the documentation saying otherwise. Note also that the documentation is naming the argument object=
where it should be obj=
according to the code.
The obj parameter is not referenced in the JSON that is stored in the DB. It is however prepended to the message in the system/console logs. You can also verify in the DB directly: select * from core_job order by id desc limit 1 \gx
(to get the results of the last script execution). data["log"]
has no reference to any object.
@arthanson what is the status of this issue?
Deployment Type
Self-hosted
NetBox Version
v4.0.2
Python Version
3.11
Steps to Reproduce
self.log_info(some_object, message)
Expected Behavior
Prior to 4.0 the object passed to
log_info
was displayed with a hyperlink to quicly reach the details view.Observed Behavior
Now we have a URL column instead wich we have to copy and paste into the browser or search for the name of the object.