During an outbreak, the perceived infection risk of an individual affects his/her behavior during an epidemic to lower the risk. We incorporate the awareness of infection risk into the Volz-Miller SIR epidemic model, to study the effect of awareness on disease dynamics. We consider two levels of awareness, the local one represented by the prevalence among the contacts of an individual, and the global one represented by the prevalence in the population. We also consider two possible effects of awareness: reducing infection rate or breaking infectious edges. We use the next generation matrix method to obtain the basic reproduction number of our models, and show that awareness acquired during an epidemic does not affect the basic reproduction number. However, awareness acquired from outbreaks in other regions before the start of the local epidemic reduces the basic reproduction number. Awareness always reduces the final size of an epidemic. Breaking infectious edges causes a larger reduction than reducing the infection rate. If awareness reduces the infection rate, the reduction increases with both local and global awareness. However, if it breaks infectious edges, the reduction may not be monotonic. For the same awareness, the reduction may reach a maximum on some intermediate infection rates. Whether local or global awareness has a larger effect on reducing the final size depends on the network degree distribution and the infection rate.