move log type to beginning and replace tags