我们使用的是第 3 方库,该库又依赖于 jna。我们设置了jna.debug_load=true,但在任何地方都看不到相关日志。即使通过 cmd 提示符启动我们的程序并将控制台日志定向到文件,日志也不会被看到。关于此的文档不多,因此请提供帮助。
有没有办法让它们显示在我们的应用程序日志中(我们使用 log4j 1.2.x)。
具体来说,我们想知道它在哪里找到 jnidispatch.dll
最佳答案
jna.debug_load=true
设置适用于 JNA 加载的外部库/DLL,但不适用于其自身的 native jnidispatch.dll
。每the JNA FAQ为此,您需要jna.debug_load.jna
:
Set the system property
jna.debug_load=true
, and JNA will print its library search steps to the console.jna.debug_load.jna
will trace the search for JNA's own native support.
对于日志记录本身,JNA 记录到 java.util.logging
。您需要使用答案to this question中概述的解决方案之一将其重定向到log4j。
关于java - 尽管使用 jna.debug_load=true jna 库似乎没有打印其 dll 搜索的步骤。可能出什么问题了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66905545/