implement new logging logic