Check out conversion patterns in pattern layout.

Here is a sample from my log4j config file:

<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n"/>
</layout>

You can define any layout you want using the PatternLayout.

http://jakarta.apache.org/log4j/

Jake

At 04:10 PM 10/21/2002 -0700, you wrote:

Sorry if this is newbie but I am somewhat new to Java. I have poured
thru several books and cannot find anything that does what I want.

I have to generate reports with multiple columns of variable width. I
need a java class to format these. In C, I would do this:
printf("%10s %10s %-10s", string1, string2, string3);

This would effectively create three columns 10 characters wide and right
justify the last column. I am sure I could 'jerry rig' this behavior but
this is part of an application that will get heavy usage and I would
prefer a clean, robust approach. (Note: This is a very scaled down
example, the actual reporting is much more complex)

Does tomcat come with a utility to do this? (or does anyone know of any
public domain classes out there)

Much thanks,
Chuck


----------
This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission. If verification is required please
request a hard-copy version.

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to