A substantial amount of cephalexin is eliminated through the kidney. It is not a safe drug for patients with impaired renal function or elderly patients, as it can result in impaired excretion and toxicity.