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 7733589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:01:54+00:00 2026-06-01T07:01:54+00:00

I’m building a jsf Web App in Eclipse, and I’ve given the app a

  • 0

I’m building a jsf Web App in Eclipse, and I’ve given the app a logger. I’m using the log4j API to log into a db in my server. to acomplish this I followed this tutorial and everything works fine.

The “message” put into the logger has the following format: ((userName)) << clientNumber>> – actionLogged

Problem

since this is going into a db and I’m going to have to give a report on the logged information, I need to be able to filter through the userName, the clientNumber and the Actions but I can’t really do that if I have a super long String with all the info in the “message” column, so my first thoughts were these:

Possible Solution #1
Is there a way to parse the message in the log4j.properties file before I insert it into the db so that I may insert the parsed strings into the corresponding columns in the table?

Possible Solution #2
Is there a way to cheat the insert statement in the log4j.properties so that I can change the format and add commas, quotes to the message itself so that the API inserts into the rest of the columns ( i.e. *userName’, ‘clientNumber’, ‘actionLogged )

Possible Solution #3
When I do the insert into the table in my db, I use a trigger to parse the message and insert the values into a second table (or the same one) with the correct userName, clientNumber and Action Columns.

Please give this some thought and let me know what you think is the best approach. or if you want to suggest a better solution, please go ahead, Thanks!!!

~Myy

  • 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-01T07:01:59+00:00Added an answer on June 1, 2026 at 7:01 am

    What I recommend anybody using the log4J is that if you want the fast and easy way to do it, is to create a trigger before the insert in the DB. This way you can parse the message coming in, since you can’t really parse it with log4J. So I added 3 more columns to my Table, userName, ClientId and Action. then I parsed the log4j "message" and populated the fields in the insert with it. Hope this helps somebody someday having the same trouble I did.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

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.