Using RegEx and Java to Split a String in Coldfusion

I was looking for a great way to split a string using a regex expression. Ben Nadel had a good post where he’s creating an RESplit() method. This was a little more than I wanted to go into, and after some more searching I found the solution was to use Java (usually is the solution ;-) as shown by Raymond Camden. So without further discussion, here’s what you need:

// Splitting a query column value by linefeeds
// You could just as easily do this with any RegEx
ItemsArray = myQuery.Notes[1].split( chr(13) );

Change JRun and Coldfusion Log Locations

Best practices dictates that we store our log files on a different drive than the host OS. The idea is to protect our OS in the event our logs get to large (possible if rotation isn’t set up or in some DOS attacks).

Coldfusion

Changing the coldfusion logs location is the easiest of all.

  1. Open your browser and navigate to your CF administrator. Usually it will me something like http://localhost:8300/CFIDE/Administrator.
  2. In the menu, under Debugging & Logging click on Logging Settings
  3. Edit the log file system path and submit changes.
  4. Restart your coldfusion server.

JRun Event Logs

You can modify the event log location by editing your server’s jrun.xml. Open that file and do a search for “jrunx.logger.LoggerService”.

You’ll want to edit the “<attribute name=”filename”>{jrun.rootdir}/logs/{jrun.server.name}-event.log</attribute>” line.

I’ve run into an issue with setting this path to a different drive than the one your JRun administrator is running from. Will update this post of it find a solution.

More JRun4 logging info can be found at: http://livedocs.adobe.com/jrun/4/JRun_Administrators_Guide/logging4.htm

JRun stdout and stderr Logs

The out and err log locations are more difficult to modify since you’ve got to edit the Windows registry. You Penguin heads out there should see the Adobe Tech Note at http://helpx.adobe.com/legacy/kb/jrun-4-0-configuring-java.html.

  1. Open regedit (Start > search regedit)
  2. Backup your registry via File > Export from the regedit console
  3. Navigate the registry to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  4. Look for your JRun server’s name and edit (right-click > Modify) SystemError and SystemOut. Set the file system path you wish, e.g. E:\JRun\{jrun.server.name}\{jrun.server.name}-err.log
  5. Go to your Windows Services and restart the JRun server service.

 

Running Coldfusion 9 Without IIS6 Metabase

I’ve installed CF9 a few times, but until recently it’s always been a rushed affair and I just bumbled through the install to get a working server up fast. This time around I decided to do some research and perform the install with  performance and security in mind.

It always bothered me that when installing CF9 you had to enable the IIS6 Metabase role in the server just to get it working. But with update 9.0.1 that’s no longer the case. Just install that update and remove the IIS6 roles and you’re good to go.

Check out this great vid from MrBond8821:

The YouTube ID of http://www.youtube.com/embed/cjeU_4dKRYc is invalid.