I found slug away in a dictionary which says it is a verb. I'm a little bit confused now. I have a similar one slog away.Are both of them phrasal verbs having the same meaning?
The preposition away ordinarily has a locative sense—approximately, and very generally, "to or at some indefinitely distant point":
The children put their toys away.
The soldiers ran away.
But when it's used with a verb which doesn't have a clear implication of motion it bears a metaphoric temporal meaning, approximately "for some indefinite time", and usually with some sense of effort or zeal.
He labored away at his homework. = "He labored at his homework for some time".
So slug away means approximately "slug continuously for some time". (But what exactly slug means will depend on context—it might mean strike or box or swing hard at baseballs or work doggedly.)
It's also used with imperatives to give someone permission to perform some action as much or as long as they like:
A: Is it OK if I read this book?
B: Read away.
To "slug away" is to hit something again and again, it's a variation of slog.