Infrastructure as a Service (IaaS) offers consumers raw computation resources such as virtual machines. However, IaaS is far from being a secure infrastructure as the seven main security threats defined by the Cloud Security Alliance (CSA) indicate. Although an accountability system helps when mitigating known threats, previous accountability systems with logging systems solutions have not offered systematic approaches. To achieve a successful approach, we research the extent to which such logging systems help us to mitigate risks associated with the CSA threats and present a way of identifying the reference components of logging systems and how they may be arranged to satisfy logging requirements. 'Generic logging components' for logging systems are proposed. We identify a logging solution which is based on these components to mitigate the risks and identify design patterns in the context of logging in an IaaS. We propose logging solutions based on the components and the identified patterns and have implemented a prototype system of the proposed logging solutions in an IaaS to record log files where the system has a smaller trusted computing base, compared to previous work.