问题标签 [apache-commons-logging]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
118 浏览

osgi - 如何为 jsr-47 支持的包配置 commons.logging?

我有一个使用 commons.logging 的现有捆绑包。我想在 Eclipse 插件测试期间为包中的类设置 logLevel。被测对象本身没有或不需要 log4j 作为捆绑包。因此,我需要知道如何配置包中可见的 jsr-47 记录器。

0 投票
1 回答
83 浏览

java - 如何从多个程序登录到java中的单独文件

我想知道如何登录到不同的文件。这是场景。我有五个 java 程序,在每个程序中我必须创建日志记录功能。但是每个 java 程序都必须有自己的日志文件,我的意思是单独的日志文件。例如:l1.txt、l2.txt、l3.txt、l4.txt 和 l5.txt 是五个日志文件。从 log4j 教程中,我看到我可以为单个文件创建记录器。但我没有找到如何为许多文件创建以及如何允许程序访问特定的附加程序以登录到相应的文件。我正在寻找这样的计划来实施。

0 投票
2 回答
2454 浏览

java - 将 Logger 作为参数传递给另一个类

我想要做的是将 Logger 实例传递给 SessionLogger 类,我想查看初始化 Logger 的类名。

我希望在日志消息中看到 A 类而不是 SessionLogger:

我在类路径中有 commons-logging.jar 和 log4j-1.2.16.jar。Logger 是 org.apache.commons.logging.Log 的一个实例

更新

刚刚发布它是预期的行为,导致Logger记录调用 log 方法的代码行。所以它应该以某种方式完成

0 投票
2 回答
7466 浏览

websphere - org.apache.commons.logging.impl.Jdk14Logger 类没有实现 Log

我遇到了此处描述的相同问题,但当时我不知道我的 websphere 版本

更多问题 1) 删除 commons-logging-1.1.jar 是否修复它?2)如果我真的需要将 commons-logging-1.1.jar 放在我的应用程序中怎么办?我怎样才能解决这个问题?

0 投票
2 回答
4307 浏览

java - 在 WebSphere 下使用 Log4j 从 Spring 进行日志记录

我在我的 WebSphere 应用程序中使用 log4j。我需要调试类org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor,所以我在我的 log4j.xml 文件中创建了记录器:

我还在commons-logging.propertiesweb 项目的 src/main/resources 中创建了(在 maven 中):

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

但是,Spring 不使用 log4j 进行日志记录。我在调试文件中看不到 springframework 日志,但我可以在控制台中看到其中一些(INFO)。因此,我假设 Spring 使用的 apache commons 日志记录不是使用 log4j 进行的。

是否可以(以及如何)将 Spring 使用的日志记录重定向到 WebSphere 下的 Log4j 引擎?

共享库中提供的 WebSphere 7.0、Spring 3.1.2、log4j 1.2.6、commons-logging 1.1。

0 投票
1 回答
987 浏览

java - Apache HTTP 客户端和日志记录问题

在我的 Tapestry 应用程序中,我需要在某个时候向某个 URL 发出 GET 请求。我这样做(使用 Apache 的 HttpClient 4.2.1)

当我在 Glassfish (3.1.2.2) 上部署我的 WAR 并执行相关代码时,会引发以下异常:

我在我的 pom.xml 中指定了这个

我检查并确保“未找到”的类实际上在 WEB-INF/lib/log4j-1.2.14 中。

有没有办法解决这个问题?

0 投票
0 回答
1946 浏览

log4j - Websphere 8.5 Log4J 不与 Parent First 一起使用

我试图将我的应用程序部署到 Websphere 8.5。由于某些原因,我需要使用类加载器 Parent First。

这是我的耳朵文件结构

我试图将org.apache.commons.logging.LogFactory文件放入META-INF/servicesvalueorg.apache.commons.logging.impl.Log4JLogger但它不起作用。

任何人都知道如何为 Websphere 8.5 配置 log4j?

谢谢

PS:我使用 log4j 1.2.17 和 commons-logging 1.1.3

0 投票
1 回答
5501 浏览

java - org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy

I am using Birt viewer runtime in my web application along with Mechanize and have used log4j for logging in my application. It all was working fine, but then I used java mailing api in my application and I keep receiving this exception: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.

I initially was using mail.jar which was fine, for another requirement in my project, I started using mail.1.3.3.jar and it started throwing this exception. I think there is some jar conflict among Mechanize and latest java mail jars.

I need to use either mail.1.3.3.jar or java-mail-1.4.jar.

Please advice how shall I overcome this ??

Thanks.

0 投票
1 回答
1535 浏览

java - 当我运行我的应用程序时,我在线程“main”java.lang.ExceptionInInitializerError 中得到了异常

该程序从 salesforce 中提取数据并将其写入文本文件。

请帮助我理解错误的原因。

0 投票
3 回答
4474 浏览

java - 使用pdfbox将pdf文件转换为java中的图像时缺少文本

我想将 PDF 页面转换为图像文件。使用 java 将 PDF 页面转换为图像时缺少文本。

转换后我想转换46_2.pdf的文件向我显示46_2.png

代码: