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

  • SEARCH
  • Home
  • 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 758115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:26:29+00:00 2026-05-14T15:26:29+00:00

Using clojure, I’ve been able to successfully setup log4j very simply by using this

  • 0

Using clojure, I’ve been able to successfully setup log4j very simply by using this log4j.properties file, and including log4j in my classpath.

# BEGIN log4j.properties

log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d{MMdd HHmmss SSS} %5p %c [%t] %m\n

log4j.rootLogger=DEBUG, STDOUT

Then after :use’ing clojure.contrib.logging, I’m able to print a statement with the desired formatting as expected like so:

(info "About to print this")
(debug "This is debug-level")

My question is how to achieve a consistent formatting for logging statements made from loggers configured in other libraries. I thought I could find existing loggers using org.apache.log4j.LogManager.getCurrentLoggers() and change the PatternLayouts there, but I’m not able to iterate over that enumeration in clojure, as I get the following error:

Dont know how to create ISeq from: java.util.Vector$1

I assume this is possible somehow, and probably very simply. How?

Thanks much.

  • 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-05-14T15:26:29+00:00Added an answer on May 14, 2026 at 3:26 pm

    Use enumeration-seq instead of seq:

    (enumeration-seq (org.apache.log4j.LogManager/getCurrentLoggers))
    

    For the curious, org.apache.log4j.LogManager.getCurrentLoggers() returns a java.util.Enumeration; seq doesn’t know how to operate on that, but enumeration-seq does.

    A simpler case not involving logging:

    (seq (.elements (java.util.Vector. [1 2 3]))
    ; => throws an exception
    
    (enumeration-seq (.elements (java.util.Vector. [1 2 3])))
    ; => returns (1 2 3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 381k
  • Answers 381k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, first of all - WPF is anything BUT a… May 14, 2026 at 10:08 pm
  • Editorial Team
    Editorial Team added an answer I tend to place mine in the web root (wherever… May 14, 2026 at 10:08 pm
  • Editorial Team
    Editorial Team added an answer returncode will work, although it will be None until you've… May 14, 2026 at 10:08 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.