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

Related Questions

I typed this into Clojure REPL (using the enclojure Netbeans plugin): user=> hello, world
I'm using Clojure, so this is in the context of Java regexes. Here is
I'm using Clojure, but I can read Java, so this isn't a Clojure specific
I want to automate filling in data on a website using clojure. For this
I am using clojure and hiccup (with noir) and I have this code: (defn
I've been using Clojure for a little while and want to create some projects
I would like to be able to call clojure functions using keyword arguments like
I have been using Clojure alot recently but I still don't understand what functionality
Using clojure I have a very large amount of data in a sequence and
Using Clojure 1.2, this code works (defn A [] (fn [a] (+ a 2)))

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.