What camera are you using?
Does it have a bulb setting (Bulb or Timed [B orT] depending on the make/age)? This is where the camera shutter stays open whilst the shutter release is depressed. If It does, use that, with camera on a sturdy tripod and a cable/remote release, to minimise the risk of shaking the camera during a long exposure.
Use a small aperture, to maximise depth of field/focus. This will also help lengthen the exposure to give some nice painted with light type trails etc.
If no bulb setting, opt for the longest exposure/slowest shutter speed your camera is capable of.
There is probably a way to calculate the correct exposure, but my photography has always been a little more 'hit and miss' in this kind of area.