Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!

Suz Reiner

+ Follow
since Feb 28, 2011
Apples and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Suz Reiner

I thought those who replied might like an update (so often missing from discussions). I located the source of my problem. It is a package conflict, after all. It would appear a vendor decided it would be a great idea to repackage all sorts of common/utility libraries with new names. They added a few folders to the base structure and TA-DAH... no-one's the wiser that name conflicts and package hell is afoot.... NOT!

Now... to figure a way isolate those monsters. Anyone have experience with this sort of suffering?

9 years ago

Christophe Verré wrote:How did you call your log4j property file, and where did you put it ?

I am using a log4j.xml file placed within reach of my package. So, in eclipse it would be located at: /src/log4j.xml. Log4j is creating all the log files specified by the appenders I have defined. And, data is being written to those log files with the exception of my custom logger/appender definition (despite the file having been created by log4j).

It is curious. I thought I was having a conflict between jars somewhere but I ran through my environment to root-out potential conflicts. I think I have cleared them but still I'm stubbing my toes and smiling about it.

9 years ago

Christophe Verré wrote:In [logger name="DailyRoll "], is the space a typo ? I don't know if log4j ignores it or not, but it's worth removing it.

Yep, the space is a typo (I changed the names to protect the innocent... from public exposure ).

Thank you for taking a look.

And thank you for the warm welcome, Vijitha Kumara.
9 years ago
I have a custom logger and a log4j.xml combination that, I hoped would send output to a specified persistent file. However, the content is being created and logged to the console instead. I'm not sure why (considering log4j is creating the intended log file). Clearly I'm missing a step. Can someone take a peak and clue me in? The code snippets are below:

private static final Logger logger = LoggerFactory.getLogger("DailyRoll");“text to add... report some stuff”);

<appender name="stickyBuns" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="daily.log" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<param name="append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="DEBUG"/>
<param name="LevelMax" value="INFO"/>

<logger name="DailyRoll " additivity="false" >
<level value="info" />
<appender-ref ref="stickyBuns"/>

9 years ago