Tuesday, June 23, 2009

Adjusting log4j in JBoss

JBoss' log4j configuration can be found at [server root]/server/default/conf/jboss-log4j.xml.

There are two important parts to tweaking your logging, the appender settings and limit categories.

The appender settings start on line 64 for jboss-4.2.2.GA. The default is :
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>

Mine look like this :

   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%-5p [%c{7}.%M] %m %n"/>

</layout>
</appender>


The difference is the ConversionPattern. Inside the brackets I use %c{7}.%M. That means that the class name will append 7 levels back, i.e. com.foo.bar.baz.buz.bam.SomeClass. The ".%M" appends the method name as well, i.e. com.foo.bar.baz.buz.bam.SomeClass.someMethod.

This way I can see the fully qualified class name and method.

Sunday, June 21, 2009

Distilled Brilliance on Python Integer equality

Excellent blog post on DZone this morning. I like the name of this blog, "Distilled Brilliance," too.

Wednesday, June 10, 2009

Safari 4

If you are a Mac user run Software Update and get Safari 4 now.

This release is significantly faster in loading pages and url completion.

The new "Top Sites" feature is really cool. Apple cribbed it from Opera, but they've improved on it.

Saturday, May 30, 2009

httpd.conf on Mac OSX

On Mac OSX Apache's httpd.conf is located here : /private/etc/apache2.

I wanted to add .xhtml files to the list of default pages served.  The solution is to simply add "index.xhtml" the "IfModule dir_module" entry on line 224:

<IfModule dir_module>
DirectoryIndex index.html, index.xhtml
</IfModule>

Thursday, May 28, 2009

Lorem ipsum generator

I've used http://www.lipsum.com/ for generating lorem ipsum text for ages.

Thanks to this nettuts.com tutorial I discovered a new Lorem ipsum generator : http://www.blindtextgenerator.com/. It is nicely configurable.

Tuesday, April 28, 2009

Where is the site-packages directory on Mac OSX?

/Library/Python/2.5/site-packages

Running :
 python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

As suggested in the Django documentation displays the directory.

can not perform DDL/DML over objects in Recycle Bin

I got this error today while trying to run jBPM drop/create scripts.

I didn't know Oracle had a recycle bin?

Theoretically the solution is to run, "purge recyclebin;" and wait. I say theoretically because my solution required dropping and recreating the user. Somehow my foreign keys didn't get moved to the recycle bin at the same time as my tables.

Additionally the "purge" command needs to be added to delete statements.