Lincoln didn't violate the law when doing it.
Suspension of habeas corpus is a legislative power. Congress passed a measure that gave Lincoln his power.
In Ex parte Milligan, 71 US 2 (1866), the Supreme Court held that the denial of habeas corpus to Milligan was in violation of the law. That doesn't mean that all denials of habeas were outside of the law, that is, some of the military detentions and denial of access to Article III courts was legal. But the Court held that Milligan's was not.
Article I, Section 9, Clause 2: "The Privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it." I don't see where it says it's a legislative power or that only Congress can suspend it.
In Ex parte Milligan, 71 US 2 (1866), the Supreme Court held that the denial of habeas corpus to Milligan was in violation of the law.
It ruled that denial of habeas corpus was illegal in areas where the federal courts operated openly. It did not say that habeas corpus could not be suspended.
Well by your logic than, Bush is in the right seeing as the only ones saying he violated the law are shrill liberals who want their power back.