Caning of children is something that needs to be urgently eliminated from our schools. There are those of the earlier generations that claim that it is what inculcates discipline in young children and without which society now, and in future will pay the price, dearly. But I would like to give the example of Scandinavian countries (Sweden specifically) where it is not only banned but it is illegal and the perpetrators are dealt with by the full extent of the law and their society is not only intact but flourishing.
With that said there are a number of things we can do to end this vice;
Make schools liable for the actions of their teachers. This may sound harsh, that is, why punish the institution for the actions of only one or two employees? However, this serves as a deterrent, the same way banks get fined when their employees commit fraud. Schools will be less likely to turn a blinds-eye to caning of children if they know that the actions of one of their teachers will have consequences that will reverberate throughout the entire institution. The institution will have adopt zero-tolerance stance on the caning of children, and put in place control measures such as:
Having regular mandatory staff and teacher training on appropriate interaction with children – that is what they can or cannot do.
At the beginning of every term, schools can hold meetings with all the students to encourage them to report instances of abuse/physical punishment and reassure them that they will not be victimized when they come forward.
Having anonymous whistleblowing avenues, for instance a complaints box, where the children can report the offensive teacher - for those who are too scared to publicly come forward.
Reduce/eliminate the number of isolated interactions between teachers and students. Teachers should mostly interact with students in public scenarios where there are other witnesses so in the event an abusive teacher is accused of caning a child, there are others who can corroborate the accusation.
Outside the school, the government can put in place legislation that makes it illegal to cane children and have heavy penalties associated with such offences, including but not limited to imprisonment. Additionally, those found guilty should also have investigations opened into their personal lives to establish whether they also abuse their own children as well as students.
Finally the Kenyan National Union of Teachers should suspend the teaching licence of any accused teacher and stop them from teaching until they are cleared of any wrongdoing. Those who are found guilty should be permanently stricken off the national registry of teachers, legal proceedings opened against them and not allowed to work with children in future (or only to do so after some rigorous rehabilitation).
Children can be unruly, and at times can lack empathy for others which can lead to bullying, fighting and other misdemeanours and so measures need to be taken to discourage or inhibit bad behaviour. However, these punishments should be humane, for instance sweeping the class during lunch time (after they have eaten) or being the one who cleans the chalk board (it’s very dusty work – I should know, I did it quite a lot during my time in primary school), or some other appropriate punishment.
In closing, disciplining children is a very sensitive issue, but it shouldn’t be solely up to the school and teachers to discipline children but parents have a critical role to play, I mean they are your/our children after all. Then again what do I know, I’m not a parent.
Hope this helped.
You can read more on how I was disciplined in school in William Chesoni's answer to Are Kenyan schools strict?
 In Sweden, a generation of kids who've never been spanked