I have a situation in which I want Log4J 2 to determine which directory to use for logging. The pseudocode is as follows: The configuration I have for properties (in log4j2.xml) is as follows: What I think it should look like: What I’m not sure on is how to get both ${env:LOG_DIR} and ${sys:catalina.base} options in the LOG_DIR property in
Tag: configuration
Struts2.5.12 – NPE while using getText method from ActionSupport
I am migrating a project from Struts 2.3.3 to Struts 2.5.12 and I see NullPointerException when using the getText method from ActionSupport class. My action class extends ActionSupport class. I have package.properties file also packaged in the war file. My action class looks like: And in package.properties file I have I see the below exception when the bean for my
Disable logging from log4j 2 library, how?
I’m using log4j 2 for logging and want to turn off the log messages from the library itself, e.g.: I got the following in my log4j2.XML file but I still get DEBUG messages like the one above: This question is not a duplicate of Disabling Log4J Output in Java because I don’t want to turn off all output, only the
How Spring @Autowired binds the SessionFactory object even if there is no SessionFactory instance available
I’m using Hibernate and Spring with Java-based configurations. My config file is this one: Working fine. No problem with this, but when I manually try to set the sessionfactory parameter for trasactionManager, like this: The IDE is showing: So, I created a sessionFactory like below and passed to trasactionManager It worked. My question is how spring autowired the sessionFactory object
Lazy way to convert log4j.xml to log4j2.xml [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 2 years ago. Improve this question Is there a easy/lazy way (e.g a shell script etc) to
Stop displaying logger output to console from dependencies
I have a few Maven dependencies in my Java project that clutter the console output with redundant log info. I want to disable such logging. Setting the additivity property to false might help. But could not use it properly. I am looking for a log4j.xml config that will only print log output (warn, error, …) from my project and not
how to log only one level with log4j2?
I’m using log4j2 in my application. What I want is everything up to ‘debug’ to go to console, everything up to ‘info’ to go to myapp.log, and ONLY ‘info’ to go to ‘myapp-audit.log’. The reason is, INFO mostly consists of successful modifications to data (ex. ‘user created’, ‘user updated’, ‘user deleted’, and so on). If is effectively an audit log
Java project with Gradle in IntelliJ IDEA: cannot resolve symbol ‘google’ but project compiles
I have a toy Java project set up with Gradle in IntelliJ IDEA 13.1.2. It compiles and runs fine, but the IDE highlights ‘google’ in as red and warns “Cannot resolve symbol ‘google'”. Any idea how to fix it? I have tried 1) deleting .idea/ and re-creating the project in IntelliJ IDEA, and 2) re-importing project from the manually created
Can’t remove jar from Web App Library
How can I remove the jars in my Web App Library? I manually added a couple jars to the web app library. My program is now pitching a fit so I clearly need to remove them. However, when I go to the Build Path, the “Remove” is greyed out. Answer A project’s Web App Library is composed automatically by Eclipse
What is the default package name for Struts in struts.xml?
I created a new class called RegesterAction but I didn’t keep this class in any package. How can I configure this class in the struts.xml? Below is the struts.xml file but I’m unable to understand the attribute values “default” and struts-default. Answer The package name is completely independent of your code artifacts. The struts-default package is… the Struts 2 default