Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8812695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:39:47+00:00 2026-06-14T03:39:47+00:00

I am seeing strange behavior using log4j that I am completely stumped on. This

  • 0

I am seeing strange behavior using log4j that I am completely stumped on. This is my first time using it with BlazeDS and I am hoping it is a small issue I have missed.

In this web app, I am using log4j for logging from 2 java classes, as well as blazeDS. I am hooking BlazeDS into commons-logging via org.springframework.flex.core.CommonsLoggingTarget, and then using log4j as the underlying logger.

I have set appenders for both “Console” and “MyFile” under the blazeds logger, and while the console output is working as expected, nothing is written to MyFile. The file is in fact created, but stays at 0KB. On the other hand, my two java classes are logging just fine both to the console and their rolling file. I am seeing this behavior both when I test locally and also when I deploy to Tomcat.

One last detail – when testing locally, I changed the MyFile path to an absolute path, and saw that the file was beign appended to. This would lead me to believe it is an issue with the relative path however it has been working fine for my java logging.

commons-logging.properties:

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

log4j.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configuration status="trace" debug="true">
  <appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </Console>

    <RollingFile name="RollingFile" fileName="logs/ImpactTradeQuery.log"
                                    filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
      <PatternLayout>
        <pattern>%d %p %C{1.} [%t] %m%n</pattern>
      </PatternLayout>
      <Policies>
        <TimeBasedTriggeringPolicy />
        <SizeBasedTriggeringPolicy size="25 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="25"/>
    </RollingFile>

    <File name="MyFile" immediateFlush="true" fileName="logs/app.log">
      <PatternLayout>
        <pattern>%d %p %C{1.} [%t] %m%n</pattern>
      </PatternLayout>
    </File>
  </appenders>
  <loggers>
    <root level="trace">
        <appender-ref ref="Console"/>
    </root>
    <logger name="flex.samples.trade.tradeService" level="trace" additivity="False">
        <appender-ref ref="RollingFile"/>
        <appender-ref ref="Console"/>
    </logger>
    <logger name="flex.samples.ConnectionHelper" level="trace" additivity="False">
        <appender-ref ref="RollingFile"/>
        <appender-ref ref="Console"/>
    </logger>
    <logger name="blazeds" level="trace" additivity="True">
        <appender-ref ref="MyFile"/>
        <appender-ref ref="Console"/>
    </logger>
    </loggers>
</configuration>

services-config.xml:

<logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Error">
            <properties>
                <prefix>[BlazeDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
        <target class="org.springframework.flex.core.CommonsLoggingTarget" level="All">
            <properties>
                <categoryPrefix>blazeds</categoryPrefix>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
    </logging>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:39:48+00:00Added an answer on June 14, 2026 at 3:39 am

    Turned out to be a missing jar file in Tomcat (log4j-jcl) that was causing the issue. Once the library was properly packaged with the app the logging worked as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MVC3 .NET4.0 (VB), and I'm seeing some strange behavior on a simple
I am seeing strange behavior of jQuery UI draggable elements using Chrome. In the
I'm seeing strange behavior when I try to parse XML using the LINQ XmlReader
I'm seeing a strange behavior in my code, here's an analogous example using apples
I'm using JBoss Seam 2.2 in my application, and am seeing some strange behavior
We're seeing a strange behavior where things that get cached (in the IE/wininet cache)
I'm seeing some strange (to me anyway) behavior when using MakeRelativeUri on Mono (2.6.7).
I'm seeing some strange behaviour with my Rails3 app. Note that I'm using the
I'm seeing strange behaviour when using PostgreSQL in a Hibernate/JPA environment with a single
I'm seeing strange behavior when scaling Delayed::Job workers on Heroku. I have a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.